From eea4651a9d4fd837cd68890d571da34fd1599345 Mon Sep 17 00:00:00 2001 From: Rick Companje Date: Sun, 6 Jun 2021 22:22:06 +0200 Subject: [PATCH] Update index.js --- src/js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }