fix(sheet-toolbar): Make robust against mail view null names (Sentry 3861)

This commit is contained in:
Ben Gotow 2015-11-04 16:04:28 -08:00
parent 408e96945c
commit 86fc3a4c2b

View file

@ -44,11 +44,11 @@ class ToolbarBack extends React.Component
CategoryStore ?= require './flux/stores/category-store' CategoryStore ?= require './flux/stores/category-store'
FocusedMailViewStore ?= require './flux/stores/focused-mail-view-store' FocusedMailViewStore ?= require './flux/stores/focused-mail-view-store'
@state = @state =
categoryName: FocusedMailViewStore.mailView().name categoryName: FocusedMailViewStore.mailView()?.name
componentDidMount: => componentDidMount: =>
@_unsubscriber = FocusedMailViewStore.listen => @_unsubscriber = FocusedMailViewStore.listen =>
@setState(categoryName: FocusedMailViewStore.mailView().name) @setState(categoryName: FocusedMailViewStore.mailView()?.name)
componentWillUnmount: => componentWillUnmount: =>
@_unsubscriber() if @_unsubscriber @_unsubscriber() if @_unsubscriber