diff --git a/color/color-common.ts b/color/color-common.ts index 0de2a470c..2772a5515 100644 --- a/color/color-common.ts +++ b/color/color-common.ts @@ -94,6 +94,12 @@ export class Color implements definition.Color { } public static equals(value1: definition.Color, value2: definition.Color): boolean { + // both values are falsy + if (!value1 && !value2) { + return true; + } + + // only one is falsy if (!value1 || !value2) { return false; } diff --git a/ui/styling/font-common.ts b/ui/styling/font-common.ts index 20454269f..a5c9604e6 100644 --- a/ui/styling/font-common.ts +++ b/ui/styling/font-common.ts @@ -84,6 +84,16 @@ export class Font implements definitios.Font { } public static equals(value1: Font, value2: Font): boolean { + // both values are falsy + if (!value1 && !value2) { + return true; + } + + // only one is falsy + if (!value1 || !value2) { + return false; + } + return value1.fontFamily === value2.fontFamily && value1.fontSize === value2.fontSize && value1.fontStyle === value2.fontStyle &&