Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protect config.js from attempting to use invalid theme name (which corrupted mermaid use until reset()) #2987

Merged
merged 3 commits into from May 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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