Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions newIDE/app/src/Utils/Window.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ export default class Window {
static setWindowBackgroundColor(newColor: string, targetDocument?: Document) {
const doc = targetDocument || document;

if (!newColor) {
// Be defensive against themes missing a color (for instance, a
// newly added variable that an older or custom theme doesn't define):
// skip the update rather than crashing.
return;
}

if (documentBackgroundColors.get(doc) === newColor) {
// Avoid potentially expensive DOM query/modification if no changes needed.
return;
Expand Down
Loading