Skip to content

Conversation

@breautek
Copy link
Contributor

@breautek breautek commented Jan 8, 2026

Platforms affected

Android

Motivation and Context

Java's Throwable.getMessage() may return null, therefore when handling generic Exception instances, it is unsafe to assume that getMessage() will return a string.

In some cases, this result gets passed to the LOG apis which does not handle nulls and thus will error with a NullPointerException.

Reproduction steps is unknown but this was discovered in my app via Sentry report:

image image

Description

I searched for usages of Exception e and any place where it used .getMessage() API. The .getMessage() usage was removed, and used the LOG.e(String tag, String message, Throwable e) signature to log the exception where applicable.

Testing

NPM test runs successfully.

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@codecov-commenter
Copy link

codecov-commenter commented Jan 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.39%. Comparing base (eaca570) to head (b9b12a5).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1878   +/-   ##
=======================================
  Coverage   61.39%   61.39%           
=======================================
  Files          24       24           
  Lines        4919     4919           
=======================================
  Hits         3020     3020           
  Misses       1899     1899           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@breautek breautek merged commit 7a353fe into apache:master Jan 8, 2026
11 checks passed
@breautek breautek deleted the fix/npe branch January 8, 2026 20:14
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.

3 participants