Skip to content

chore: sync upstream PR #7803 - fix(android): Subsequent build crash with missing version data#23

Open
riderx wants to merge 2 commits intoplusfrom
sync/upstream-pr-7803
Open

chore: sync upstream PR #7803 - fix(android): Subsequent build crash with missing version data#23
riderx wants to merge 2 commits intoplusfrom
sync/upstream-pr-7803

Conversation

@riderx
Copy link
Member

@riderx riderx commented Nov 28, 2025

Upstream PR Sync

This PR syncs changes from an external contributor's PR on the official Capacitor repository.

Original PR

  • PR: #7803
  • Title: fix(android): Subsequent build crash with missing version data
  • Author: @aeharding

Automation

  • CI will run automatically
  • Claude Code will review for security/breaking changes
  • If approved, this PR will be auto-merged

Synced from upstream by Capacitor+ Bot

Summary by CodeRabbit

  • Bug Fixes
    • Fixed null handling in version detection to prevent potential stability issues.

@coderabbitai
Copy link

coderabbitai bot commented Nov 28, 2025

📝 Walkthrough

Walkthrough

A null-safety guard was added in the isNewBinary() method to conditionally assign versionName only when the underlying property is not null, preserving the initial empty string value when null is encountered.

Changes

Cohort / File(s) Summary
Null-safety Guard
android/capacitor/src/main/java/com/getcapacitor/Bridge.java
Added conditional check in isNewBinary() to guard versionName assignment against null values from pInfo.versionName, preventing potential null handling issues.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A guardian check, so small yet wise,
Null shall not pass before my eyes!
Empty strings safe, no crashes here,
One little if guards the frontier. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately summarizes the main change - it references the synced upstream PR and its purpose (fixing an Android build crash caused by missing version data).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sync/upstream-pr-7803

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@riderx riderx force-pushed the sync/upstream-pr-7803 branch from 679b7c3 to 9b02d96 Compare November 28, 2025 15:03
@riderx riderx force-pushed the sync/upstream-pr-7803 branch from 9b02d96 to 83cf40d Compare February 4, 2026 06:14
Copilot AI review requested due to automatic review settings February 4, 2026 06:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Syncs upstream Capacitor fix for an Android crash on subsequent builds when PackageInfo.versionName is missing (null).

Changes:

  • Guard assignment of versionName to avoid null propagation that can lead to a crash in version comparisons.
  • Preserve existing stored binary version comparison behavior while preventing NPEs.

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

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