Skip to content

Commit

Permalink
8890-dracula-at-night-theme-failure
Browse files Browse the repository at this point in the history
Theme Dracula-at-night fails when registering it in Theia because theme colors contain null properties.
Fix: removed null and undefined color props from theme colors upon registration.

Signed-off-by: Dan Arad <[email protected]>
  • Loading branch information
danarad05 authored and amiramw committed Feb 23, 2021
1 parent 7460e6f commit 55b7ea6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/monaco/src/browser/monaco-theming-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export class MonacoThemingService {
return;
}
}
this.cleanEmpty(json.colors);
return json;
}

Expand Down Expand Up @@ -202,4 +203,12 @@ export class MonacoThemingService {
return str;
}

private cleanEmpty(obj: any): void {
for (const key in obj) {
// eslint-disable-next-line no-null/no-null
if ([null, undefined].includes(obj[key])) {
delete obj[key];
}
}
}
}

0 comments on commit 55b7ea6

Please sign in to comment.