Skip to content

Commit

Permalink
Do not use "in" for checking if a themeId is known
Browse files Browse the repository at this point in the history
  • Loading branch information
thsparks committed Mar 7, 2025
1 parent 8e956d9 commit 801ec14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion react-common/components/theming/themeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class ThemeManager {
}

public isKnownTheme(themeId: string): boolean {
return pxt.appTarget.colorThemeMap && themeId in pxt.appTarget.colorThemeMap;
return !!pxt.appTarget?.colorThemeMap?.[themeId];
}

public getAllColorThemes(): pxt.ColorThemeInfo[] {
Expand Down

0 comments on commit 801ec14

Please sign in to comment.