FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(android): setTextColor is non-nullable, prevent null exception by NathanWalker · Pull Request #11147 · NativeScript/NativeScript · GitHub

fix(android): setTextColor is non-nullable, prevent null exception - #11147

Merged
NathanWalker merged 2 commits into
mainfrom
fix/android-text-color-null-exception
Mar 28, 2026
Merged

fix(android): setTextColor is non-nullable, prevent null exception#11147
NathanWalker merged 2 commits into
mainfrom
fix/android-text-color-null-exception

Conversation

NathanWalker commented Mar 27, 2026
edited
Loading

Copy link
Copy Markdown
Contributor
  • ensures that setTextColor method is only called with a defined value, preventing crashes based on timing/race

Prevents innocent app crash due to bindings update timing (often on page navigations):

Error: java.lang.NullPointerException
StackTrace:
  [color:setNative](file:///data/data/com.example.app/files/files/app/vendor.mjs)

This occurs because this.nativeTextViewProtected.setTextColor(value) is not nullable.
https://android.googlesource.com/platform/frameworks/base/+/refs/heads/main/core/java/android/widget/TextView.java#5602

nx-cloud Bot commented Mar 27, 2026
edited
Loading

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 9bc2fbf

Command Status Duration Result
nx test apps-automated -c=android ✅ Succeeded 3m 46s View ↗
nx run-many --target=test --configuration=ci --... ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-27 22:24:10 UTC

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull request overview

This PR prevents an Android crash in TextBase by ensuring setTextColor(...) isn’t invoked with a null/undefined value during timing/race conditions in bindings updates.

Changes:

  • Guarded the Android colorProperty.setNative path to avoid calling TextView.setTextColor(...) with an undefined value.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…lorProperty.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>
NathanWalker merged commit e34a8d0 into main Mar 28, 2026
7 checks passed
NathanWalker deleted the fix/android-text-color-null-exception branch March 28, 2026 03:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL