Skip to content

Fix unhandled ArithmeticException in div_zero button click listener - #250

Open
sentry[bot] wants to merge 1 commit into
mainfrom
claude/fix-div-zero-crash-ANDROID-M0
Open

Fix unhandled ArithmeticException in div_zero button click listener#250
sentry[bot] wants to merge 1 commit into
mainfrom
claude/fix-div-zero-crash-ANDROID-M0

Conversation

@sentry

@sentry sentry Bot commented Aug 6, 2026

Copy link
Copy Markdown

Summary

The div_zero button contained a hardcoded int t = 5 / 0 expression that unconditionally threw an unhandled ArithmeticException, crashing the app on every tap.

Fix

Wrapped the division in a try/catch (ArithmeticException e) block and capture the exception via Sentry.captureException(e), making it a handled error instead of a fatal crash.

Changes

  • MainActivity.java line 53: wrap 5 / 0 in try/catch and capture exception with Sentry

Fixes ANDROID-M0

Wrap the hardcoded 5 / 0 division in a try/catch block and capture
the ArithmeticException via Sentry instead of letting it crash the app.

Fixes [ANDROID-M0](https://demo.sentry.io/issues/7653043052/)
@sentry
sentry Bot requested a review from sdzhong as a code owner August 6, 2026 02:58
@sentry

sentry Bot commented Aug 6, 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 Aug 6, 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 (2bef372) to head (ac8fd68).

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    #250   +/-   ##
=====================================
  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