mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
protect config.js from attempting to use invalid theme name
This commit is contained in:
parent
7cba061d18
commit
0127238645
@ -27,7 +27,7 @@ export const updateCurrentConfig = (siteCfg, _directives) => {
|
|||||||
|
|
||||||
cfg = assignWithDepth(cfg, sumOfDirectives);
|
cfg = assignWithDepth(cfg, sumOfDirectives);
|
||||||
|
|
||||||
if (sumOfDirectives.theme) {
|
if (sumOfDirectives.theme && theme[sumOfDirectives.theme]) {
|
||||||
const tmpConfigFromInitialize = assignWithDepth({}, configFromInitialize);
|
const tmpConfigFromInitialize = assignWithDepth({}, configFromInitialize);
|
||||||
const themeVariables = assignWithDepth(
|
const themeVariables = assignWithDepth(
|
||||||
tmpConfigFromInitialize.themeVariables || {},
|
tmpConfigFromInitialize.themeVariables || {},
|
||||||
@ -59,7 +59,7 @@ export const setSiteConfig = (conf) => {
|
|||||||
siteConfig = assignWithDepth({}, defaultConfig);
|
siteConfig = assignWithDepth({}, defaultConfig);
|
||||||
siteConfig = assignWithDepth(siteConfig, conf);
|
siteConfig = assignWithDepth(siteConfig, conf);
|
||||||
|
|
||||||
if (conf.theme) {
|
if (conf.theme && theme[conf.theme]) {
|
||||||
siteConfig.themeVariables = theme[conf.theme].getThemeVariables(conf.themeVariables);
|
siteConfig.themeVariables = theme[conf.theme].getThemeVariables(conf.themeVariables);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user