diff --git a/src/js/index.js b/src/js/index.js index b8fdc08..1367020 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -52,7 +52,7 @@ const history = syncHistoryWithStore(envs.platform === 'ios-app' ? hashHistory : window.onbeforeunload = event => { const state = store.getState(); - if (state.files.current.unSavedData) { + if (state.files.current && state.files.current.unSavedData) { event.returnValue = 'You have unsaved work'; return event.returnValue; }