diff --git a/components/Editor.js b/components/Editor.js index 02cd3cd..49dec64 100644 --- a/components/Editor.js +++ b/components/Editor.js @@ -257,7 +257,9 @@ class Editor extends React.Component { } updateLanguage(language) { - this.updateSetting('language', language.mime || language.mode) + if (language) { + this.updateSetting('language', language.mime || language.mode) + } } updateBackground({ photographer, ...changes } = {}) { diff --git a/components/Themes/index.js b/components/Themes/index.js index 334f3d3..61cd7df 100644 --- a/components/Themes/index.js +++ b/components/Themes/index.js @@ -67,12 +67,14 @@ class Themes extends React.PureComponent { } handleThemeSelected = theme => { - const { toggleVisibility, update } = this.props - if (theme.id === 'create') { - toggleVisibility() - this.dropdown.current.closeMenu() - } else { - update(theme.id) + if (theme) { + const { toggleVisibility, update } = this.props + if (theme.id === 'create') { + toggleVisibility() + this.dropdown.current.closeMenu() + } else { + update(theme.id) + } } }