Skip to content

Commit 9bc2fbf

Browse files
fix(android): use explicit null/undefined check and update type in colorProperty.setNative
Agent-Logs-Url: https://github.com/NativeScript/NativeScript/sessions/bb1580df-8f26-4e42-85b4-2c73c1bc54bc Co-authored-by: NathanWalker <457187+NathanWalker@users.noreply.github.com>
1 parent 7cf88ea commit 9bc2fbf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/core/ui/text-base/index.android.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,11 +408,11 @@ export class TextBase extends TextBaseCommon {
408408
[colorProperty.getDefault](): android.content.res.ColorStateList {
409409
return this.nativeTextViewProtected.getTextColors();
410410
}
411-
[colorProperty.setNative](value: Color | android.content.res.ColorStateList) {
411+
[colorProperty.setNative](value: Color | android.content.res.ColorStateList | null | undefined) {
412412
if (!this.formattedText || !(value instanceof Color)) {
413413
if (value instanceof Color) {
414414
this.nativeTextViewProtected.setTextColor(value.android);
415-
} else if (value) {
415+
} else if (value != null) {
416416
this.nativeTextViewProtected.setTextColor(value);
417417
}
418418
}

0 commit comments

Comments
 (0)