roshakorost / Phial

Phial is an Android library that captures your bug data directly to Jira or other services.
Apache License 2.0
9 stars 2 forks source link

Added null check to prevent a crash when removing button twice in a row. #29

Open sttimchenko opened 6 years ago

sttimchenko commented 6 years ago

The root of the issue is that button is being removed twice, causing NullPointerException on the second removal. It is so because button is removed from the map on OverlayPresenter#onButtonMoved() at first normally, then activity is stopped, causing the button to be removed again on OverlayPresenter#onActivityStopped(Activity activity). As it seems that both calls are expected simple null check will have suffice here to prevent an unhandled exception that crash the app.

sttimchenko commented 6 years ago

Found the duplicate at fix_animation_race branch.

roshakorost commented 6 years ago

We will review the request tomorrow. But please, check the pmd issues. Run ./gradlew check to run pmd and tests.