From 3ca487dee8a503c770820d831c0c47d10f3591db Mon Sep 17 00:00:00 2001 From: Miika Turunen Date: Thu, 31 Aug 2017 22:12:48 +0300 Subject: [PATCH] Added check if state exist --- react/src/components/dashboard/settings/settings.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/react/src/components/dashboard/settings/settings.js b/react/src/components/dashboard/settings/settings.js index 101565e..8db8120 100644 --- a/react/src/components/dashboard/settings/settings.js +++ b/react/src/components/dashboard/settings/settings.js @@ -102,7 +102,7 @@ class Settings extends React.Component { try { const _appConfigSchema = window.require('electron').remote.getCurrentWindow().appConfigSchema; const _appSettings = this.props.Settings.appSettings ? this.props.Settings.appSettings : Object.assign({}, window.require('electron').remote.getCurrentWindow().appConfig); - + console.warn(_appConfigSchema); this.setState(Object.assign({}, this.state, { appConfigSchema: _appConfigSchema, appSettings: _appSettings, @@ -503,7 +503,7 @@ class Settings extends React.Component { for (let key in _appConfig) { if (typeof _appConfig[key] === 'object') { - if (this.state.appConfigSchema[key].display) { + if (this.state.appConfigSchema[key] && this.state.appConfigSchema[key].display) { items.push( @@ -567,7 +567,7 @@ class Settings extends React.Component { } } } else { - if (this.state.appConfigSchema[key].display) { + if (this.state.appConfigSchema[key] && this.state.appConfigSchema[key].display) { items.push(