Skip to content

Commit

Permalink
Check for valid sessionState props
Browse files Browse the repository at this point in the history
  • Loading branch information
Eko Mirhard committed May 18, 2017
1 parent 6bd247f commit 7375a17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/components/posture/PostureMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ class PostureMonitor extends Component {
// ANDROID ONLY: Listen to the hardware back button
if (!isiOS) {
this.backAndroidListener = BackAndroid.addEventListener('hardwareBackPress', () => {
if (this.props.sessionState.showSummary) {
if (this.props.sessionState && this.props.sessionState.showSummary) {
this.props.navigator.resetTo(routes.postureDashboard);
} else if (this.state.sessionState !== sessionStates.STOPPED
&& !this.state.hasPendingSessionOperation) {
Expand Down Expand Up @@ -294,7 +294,7 @@ class PostureMonitor extends Component {
});
}

if (this.props.sessionState.showSummary) {
if (this.props.sessionState && this.props.sessionState.showSummary) {
this.setState({ forceStoppedSession: true }, () => {
this.statsHandler(this.props.sessionState.previousSessionEvent);
});
Expand Down

0 comments on commit 7375a17

Please sign in to comment.