jonan / ForkHub

GitHub client for Android based on the abandoned official app
https://play.google.com/store/apps/details?id=jp.forkhub
Apache License 2.0
2.79k stars 434 forks source link

NPE crash when back button pressed in Issue Dashboard #323

Closed phansier closed 7 years ago

phansier commented 7 years ago

App version: 1.2.8 Source: https://play.google.com/store/apps/details?id=jp.forkhub Device: Samsung SM-G531F Android Version: 5.1 Reproduced stably.

Steps:

  1. Open issues list.
  2. Open some issue.
  3. While issue is loading, tap on back (arrow) button.

Linked with #284

Stacktrace:

09-15 23:21:33.527: E/AndroidRuntime(8563): FATAL EXCEPTION: main
09-15 23:21:33.527: E/AndroidRuntime(8563): Process: jp.forkhub, PID: 8563
09-15 23:21:33.527: E/AndroidRuntime(8563): java.lang.NullPointerException: Attempt to invoke virtual method 'int com.github.mobile.ui.ViewPager.getCurrentItem()' on a null object reference
09-15 23:21:33.527: E/AndroidRuntime(8563):     at com.github.mobile.ui.issue.IssuesViewActivity.onOptionsItemSelected(IssuesViewActivity.java:346)
09-15 23:21:33.527: E/AndroidRuntime(8563):     at android.app.Activity.onMenuItemSelected(Activity.java:3010)
09-15 23:21:33.527: E/AndroidRuntime(8563):     at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:408)
09-15 23:21:33.527: E/AndroidRuntime(8563):     at android.support.v7.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:195)
09-15 23:21:33.527: E/AndroidRuntime(8563):     at android.support.v7.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:113)
09-15 23:21:33.527: E/AndroidRuntime(8563):     at android.support.v7.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:113)
09-15 23:21:33.527: E/AndroidRuntime(8563):     at android.support.v7.widget.ToolbarWidgetWrapper$1.onClick(ToolbarWidgetWrapper.java:187)
09-15 23:21:33.527: E/AndroidRuntime(8563):     at android.view.View.performClick(View.java:5076)
09-15 23:21:33.527: E/AndroidRuntime(8563):     at android.view.View$PerformClick.run(View.java:20279)
09-15 23:21:33.527: E/AndroidRuntime(8563):     at android.os.Handler.handleCallback(Handler.java:739)
09-15 23:21:33.527: E/AndroidRuntime(8563):     at android.os.Handler.dispatchMessage(Handler.java:95)
09-15 23:21:33.527: E/AndroidRuntime(8563):     at android.os.Looper.loop(Looper.java:135)
09-15 23:21:33.527: E/AndroidRuntime(8563):     at android.app.ActivityThread.main(ActivityThread.java:5910)
09-15 23:21:33.527: E/AndroidRuntime(8563):     at java.lang.reflect.Method.invoke(Native Method)
09-15 23:21:33.527: E/AndroidRuntime(8563):     at java.lang.reflect.Method.invoke(Method.java:372)
09-15 23:21:33.527: E/AndroidRuntime(8563):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
09-15 23:21:33.527: E/AndroidRuntime(8563):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
licaon-kter commented 7 years ago

App version? App install source? Device? Android version?

Cat't repro here.

phansier commented 7 years ago

@licaon-kter Added required info into issue description