From 7cf88ea246c12cd3b004f5be1cc1a2019838341e Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Fri, 27 Mar 2026 15:00:54 -0700 Subject: [PATCH 1/2] fix(android): setTextColor is non-nullable, prevent null exception --- packages/core/ui/text-base/index.android.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/ui/text-base/index.android.ts b/packages/core/ui/text-base/index.android.ts index cb018133c3..c1b32a9cac 100644 --- a/packages/core/ui/text-base/index.android.ts +++ b/packages/core/ui/text-base/index.android.ts @@ -412,7 +412,7 @@ export class TextBase extends TextBaseCommon { if (!this.formattedText || !(value instanceof Color)) { if (value instanceof Color) { this.nativeTextViewProtected.setTextColor(value.android); - } else { + } else if (value) { this.nativeTextViewProtected.setTextColor(value); } } From 9bc2fbf5397d9181351f1d9ceaaded7949bdd0fd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Mar 2026 22:14:53 +0000 Subject: [PATCH 2/2] 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> --- packages/core/ui/text-base/index.android.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/ui/text-base/index.android.ts b/packages/core/ui/text-base/index.android.ts index c1b32a9cac..75c74f8604 100644 --- a/packages/core/ui/text-base/index.android.ts +++ b/packages/core/ui/text-base/index.android.ts @@ -408,11 +408,11 @@ export class TextBase extends TextBaseCommon { [colorProperty.getDefault](): android.content.res.ColorStateList { return this.nativeTextViewProtected.getTextColors(); } - [colorProperty.setNative](value: Color | android.content.res.ColorStateList) { + [colorProperty.setNative](value: Color | android.content.res.ColorStateList | null | undefined) { if (!this.formattedText || !(value instanceof Color)) { if (value instanceof Color) { this.nativeTextViewProtected.setTextColor(value.android); - } else if (value) { + } else if (value != null) { this.nativeTextViewProtected.setTextColor(value); } }