diff --git a/client/homebrew/brewRenderer/brewRenderer.jsx b/client/homebrew/brewRenderer/brewRenderer.jsx index 84d0d21dd..6e97ec092 100644 --- a/client/homebrew/brewRenderer/brewRenderer.jsx +++ b/client/homebrew/brewRenderer/brewRenderer.jsx @@ -193,14 +193,14 @@ const BrewRenderer = (props)=>{ // Override static theme values if a Brew theme. - if(themePath[0] == '#') { + if(themePath && themePath[0] === '#') { themePath = themePath.slice(1); rendererPath = ''; } else { rendererPath += '/'; } - if(baseThemePath && baseThemePath[0] == '#') { + if(baseThemePath && baseThemePath[0] === '#') { baseThemePath = baseThemePath.slice(1); baseRendererPath = ''; } else { diff --git a/client/homebrew/editor/metadataEditor/metadataEditor.jsx b/client/homebrew/editor/metadataEditor/metadataEditor.jsx index fadd5dd6c..573fb00c3 100644 --- a/client/homebrew/editor/metadataEditor/metadataEditor.jsx +++ b/client/homebrew/editor/metadataEditor/metadataEditor.jsx @@ -211,7 +211,8 @@ const MetadataEditor = createClass({ }); }; - const currentTheme = mergedThemes[`${_.upperFirst(this.props.metadata.theme[0] === '#' ? 'Brew' : this.props.metadata.renderer)}`][this.props.metadata.theme]; + const currentThemePath = this.props.metadata?.theme && this.props.metadata.theme[0] === '#' ? 'Brew' : this.props.metadata.renderer; + const currentTheme = mergedThemes[`${_.upperFirst(currentThemePath)}`][this.props.metadata.theme]; let dropdown; if(this.props.metadata.renderer == 'legacy') { diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index cb7570a44..4c7f4a200 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -84,7 +84,7 @@ const Snippetbar = createClass({ compileSnippets : function(rendererPath, themePath, snippets) { let compiledSnippets = snippets; - const baseSnippetsPath = themePath[0] != '#' ? Themes[rendererPath][themePath].baseSnippets : false; + const baseSnippetsPath = themePath && (themePath[0] === '#') ? false : Themes[rendererPath][themePath].baseSnippets; const objB = _.keyBy(compiledSnippets, 'groupName');