From dbfb0a3434095dfa1bb1f0aaa0dd29fb5bbf93be Mon Sep 17 00:00:00 2001 From: Dan Arad Date: Sun, 21 Feb 2021 15:25:33 +0200 Subject: [PATCH] 8890-dracula-at-night-theme-failure 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 --- packages/monaco/src/browser/monaco-theming-service.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/monaco/src/browser/monaco-theming-service.ts b/packages/monaco/src/browser/monaco-theming-service.ts index 666a2f3d3cabc..0cedbe875ecda 100644 --- a/packages/monaco/src/browser/monaco-theming-service.ts +++ b/packages/monaco/src/browser/monaco-theming-service.ts @@ -118,6 +118,7 @@ export class MonacoThemingService { return; } } + this.cleanEmpty(json.colors); return json; } @@ -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]; + } + } + } }