Skip to content

Fix ArithmeticException crash in div_zero button click handler - #241

Open
sentry[bot] wants to merge 1 commit into
mainfrom
claude/fix-divide-by-zero-crash-a17c0d
Open

Fix ArithmeticException crash in div_zero button click handler#241
sentry[bot] wants to merge 1 commit into
mainfrom
claude/fix-divide-by-zero-crash-a17c0d

Conversation

@sentry

@sentry sentry Bot commented Jul 21, 2026

Copy link
Copy Markdown

Summary\n\nThe div_zero button's click listener in MainActivity contained a hardcoded int t = 5 / 0 that threw an unhandled ArithmeticException, crashing the app.\n\n## Fix\n\nWrap the divide-by-zero operation in a try-catch block so the ArithmeticException is caught and reported to Sentry via Sentry.captureException(e) instead of crashing the app. This follows the same handled-exception pattern already used by the handled_exception button.\n\nFixes ANDROID-K3

Wrap the divide-by-zero operation in a try-catch block so the
ArithmeticException is captured and reported to Sentry instead of
crashing the app. This follows the same handled-exception pattern
already used by the handled_exception button.

Fixes [ANDROID-K3](https://demo.sentry.io/issues/7623024397/)
@sentry
sentry Bot requested a review from sdzhong as a code owner July 21, 2026 05:29
@sentry

sentry Bot commented Jul 21, 2026

Copy link
Copy Markdown
Author

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Android com.example.vu.android 24.12.26 (241226) release
Android com.example.vu.android 24.12.26 (241226) debug
Android com.example.vu.android 24.12.26 (241226) release

⚙️ android Build Distribution Settings

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (410e6f1) to head (4ce1174).

Files with missing lines Patch % Lines
...main/java/com/example/vu/android/MainActivity.java 0.00% 4 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main    #241   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files         16      16           
  Lines        883     886    +3     
  Branches      67      67           
=====================================
- Misses       883     886    +3     

☔ View full report in Codecov by Harness.
📢 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.

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.

1 participant