Skip to content

Fix ArithmeticException divide by zero crash - #251

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
arithmeticexception-divide-by-tj14aa
Draft

Fix ArithmeticException divide by zero crash#251
cursor[bot] wants to merge 1 commit into
mainfrom
arithmeticexception-divide-by-tj14aa

Conversation

@cursor

@cursor cursor Bot commented Aug 6, 2026

Copy link
Copy Markdown

Description

This PR fixes a critical crash that occurs when users tap the 'div_zero' button in MainActivity. The app was crashing with an unhandled ArithmeticException due to a hardcoded division by zero operation.

Changes

  • Added try-catch block around the division by zero operation in the div_zero button click listener
  • The ArithmeticException is now properly caught and sent to Sentry for monitoring
  • Updated the comment from "Unhandled" to "Handled" to reflect the new exception handling

Testing

The fix prevents the app from crashing when the div_zero button is tapped. The exception is still captured and reported to Sentry, but the app remains stable.

Fixes ANDROID-M0

Open in Web Open in Cursor 

Wrapped the hardcoded division by zero operation in a try-catch block
to prevent the app from crashing when the div_zero button is tapped.
The exception is now properly captured and sent to Sentry for monitoring.

Fixes [ANDROID-M0](https://demo.sentry.io/issues/7653043052/)
@sentry

sentry Bot commented Aug 6, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
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 (c0a1ecb).

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