Fix Sentry WORDPRESS-ANDROID-3F21: allow null url in ReaderActivityLauncher.openUrl#22830
Draft
Fix Sentry WORDPRESS-ANDROID-3F21: allow null url in ReaderActivityLauncher.openUrl#22830
Conversation
Sentry WORDPRESS-ANDROID-3F21 (128 users): callers pass null into openUrl, which has a TextUtils.isEmpty guard at the top of the body — but the parameter is declared non-null, so Kotlin's parameter check throws before the guard can run. Relax the parameter to String? and use isNullOrEmpty so the existing early-return handles the null case. Smart-cast keeps the rest of the body operating on a non-null url. Java callers continue to work; the upstream caller passing null (likely a deep-link or notification handler) can be tracked down separately, but the immediate crash is addressed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
Generated by 🚫 Danger |
Contributor
|
|
Contributor
|
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #22830 +/- ##
==========================================
- Coverage 37.15% 37.15% -0.01%
==========================================
Files 2314 2314
Lines 124323 124324 +1
Branches 16892 16892
==========================================
Hits 46187 46187
- Misses 74390 74391 +1
Partials 3746 3746 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Silently dropping the null caller hides the upstream bug. Add an AppLog.w breadcrumb so the deep-link or notification handler that's passing null can be tracked down. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Fixes WORDPRESS-ANDROID-3F21
Summary
Fix for Sentry WORDPRESS-ANDROID-3F21 — 128 users hit
Parameter specified as non-null is null: method ReaderActivityLauncher.openUrl, parameter url.The method has a
TextUtils.isEmpty(url)guard at the top of its body, but the Kotlin parameter null-check fires before the body runs, so a null url crashes instead of being silently dropped.This PR relaxes the parameter to
String?and usesisNullOrEmpty()so the existing early-return handles null input. Smart-cast keeps the rest of the body operating on a non-null url; Java callers and the@JvmStatic/@JvmOverloadsexports stay compatible.The upstream caller actually passing null (most likely a deep-link or push-notification handler) can be tracked down separately — this PR closes the immediate crash.
Test plan
🤖 Generated with Claude Code