Skip to content

Fix Sentry WORDPRESS-ANDROID-3F21: allow null url in ReaderActivityLauncher.openUrl#22830

Draft
nbradbury wants to merge 2 commits intotrunkfrom
fix/sentry-3f21-reader-openurl-null
Draft

Fix Sentry WORDPRESS-ANDROID-3F21: allow null url in ReaderActivityLauncher.openUrl#22830
nbradbury wants to merge 2 commits intotrunkfrom
fix/sentry-3f21-reader-openurl-null

Conversation

@nbradbury
Copy link
Copy Markdown
Contributor

@nbradbury nbradbury commented May 1, 2026

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 uses isNullOrEmpty() 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/@JvmOverloads exports 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

  • Tap a normal Reader URL — opens as before.
  • Trigger any flow that previously crashed with a null URL — now silently no-ops.

🤖 Generated with Claude Code

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>
@dangermattic
Copy link
Copy Markdown
Collaborator

1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented May 1, 2026

App Icon📲 You can test the changes from this Pull Request in Jetpack Android by scanning the QR code below to install the corresponding build.

App NameJetpack Android
Build TypeDebug
Versionpr22830-fe8771c
Build Number1488
Application IDcom.jetpack.android.prealpha
Commitfe8771c
Installation URL3cjhnrecgrdqg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented May 1, 2026

App Icon📲 You can test the changes from this Pull Request in WordPress Android by scanning the QR code below to install the corresponding build.

App NameWordPress Android
Build TypeDebug
Versionpr22830-fe8771c
Build Number1488
Application IDorg.wordpress.android.prealpha
Commitfe8771c
Installation URL2gkbidbc8l0ug
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 1, 2026

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.15%. Comparing base (4ae4042) to head (fe8771c).
⚠️ Report is 5 commits behind head on trunk.

Files with missing lines Patch % Lines
...dpress/android/ui/reader/ReaderActivityLauncher.kt 0.00% 2 Missing ⚠️
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.
📢 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.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants