diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 16809bb..3a2fc4d 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -5430,7 +5430,7 @@ const selectIsStillEditing = reselect.createSelector(selectState$4, publishState const selectPublishFormValues = reselect.createSelector(selectState$4, state => state.settings, selectIsStillEditing, (publishState, settingsState, isStillEditing) => { const { languages } = publishState, formValues = _objectWithoutProperties$2(publishState, ['languages']); - const language = languages[0]; + const language = languages && languages.length && languages[0]; const { clientSettings } = settingsState; const { language: languageSet } = clientSettings; diff --git a/src/redux/selectors/publish.js b/src/redux/selectors/publish.js index b43df3c..a3a44a2 100644 --- a/src/redux/selectors/publish.js +++ b/src/redux/selectors/publish.js @@ -44,7 +44,7 @@ export const selectPublishFormValues = createSelector( selectIsStillEditing, (publishState, settingsState, isStillEditing) => { const { languages, ...formValues } = publishState; - const language = languages[0]; + const language = languages && languages.length && languages[0]; const { clientSettings } = settingsState; const { language: languageSet } = clientSettings;