Skip to content

Commit

Permalink
Merge pull request #2987 from timmaffett/develop
Browse files Browse the repository at this point in the history
protect config.js from attempting to use invalid theme name (which corrupted mermaid use until reset())
  • Loading branch information
knsv committed May 2, 2022
2 parents bae5b9d + 4a87fa1 commit 8583c7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/config.js
Expand Up @@ -27,7 +27,7 @@ export const updateCurrentConfig = (siteCfg, _directives) => {

cfg = assignWithDepth(cfg, sumOfDirectives);

if (sumOfDirectives.theme) {
if (sumOfDirectives.theme && theme[sumOfDirectives.theme]) {
const tmpConfigFromInitialize = assignWithDepth({}, configFromInitialize);
const themeVariables = assignWithDepth(
tmpConfigFromInitialize.themeVariables || {},
Expand Down Expand Up @@ -59,7 +59,7 @@ export const setSiteConfig = (conf) => {
siteConfig = assignWithDepth({}, defaultConfig);
siteConfig = assignWithDepth(siteConfig, conf);

if (conf.theme) {
if (conf.theme && theme[conf.theme]) {
siteConfig.themeVariables = theme[conf.theme].getThemeVariables(conf.themeVariables);
}

Expand Down

0 comments on commit 8583c7b

Please sign in to comment.