maks / MGit

A Git client for Android.
https://manichord.com/projects/mgit.html
GNU General Public License v3.0
1.18k stars 164 forks source link

app crash when cancelling clone #396

Open maks opened 5 years ago

maks commented 5 years ago
java.lang.IllegalStateException: (context as Activity).currentFocus must not be null
        at com.manichord.mgit.ViewHelperKt.hideKeyboard(ViewHelper.kt:9)
        at com.manichord.mgit.repolist.RepoListActivity.hideCloneView(RepoListActivity.java:269)
        at com.manichord.mgit.repolist.RepoListActivity.access$100(RepoListActivity.java:48)
        at com.manichord.mgit.repolist.RepoListActivity$1.onActionClick(RepoListActivity.java:80)
        at me.sheimi.sgit.databinding.CloneViewBinding._internalCallbackOnClick(CloneViewBinding.java:545)
        at android.databinding.generated.callback.OnClickListener.onClick(OnClickListener.java:11)
        at android.view.View.performClick(View.java:6294)
        at android.view.View$PerformClick.run(View.java:24770)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6494)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
danielblokus commented 5 years ago

Hey, I have found steps to reproduce this bug on my device.

Steps:

  1. Turn off Internet connection on the device
  2. Navigate to Clone
  3. Tap Cancel

device: Motorola Moto C Plus; Android 7.0 / API 24

Logs: USER_COMMENT= ANDROID_VERSION=7.0 APP_VERSION_NAME=1.5.4.7 BRAND=motorola PHONE_MODEL=Moto C Plus CUSTOM_DATA= STACK_TRACE=java.lang.IllegalStateException: (context as Activity).currentFocus must not be null at com.manichord.mgit.ViewHelperKt.hideKeyboard(ViewHelper.kt:9) at com.manichord.mgit.repolist.RepoListActivity.hideCloneView(RepoListActivity.java:269) at com.manichord.mgit.repolist.RepoListActivity.access$100(RepoListActivity.java:48) at com.manichord.mgit.repolist.RepoListActivity$1.onActionClick(RepoListActivity.java:80) at me.sheimi.sgit.databinding.CloneViewBinding._internalCallbackOnClick(CloneViewBinding.java:545) at android.databinding.generated.callback.OnClickListener.onClick(OnClickListener.java:11) at android.view.View.performClick(View.java:5675) at android.view.View$PerformClick.run(View.java:22646) at android.os.Handler.handleCallback(Handler.java:836) at android.os.Handler.dispatchMessage(Handler.java:103) at android.os.Looper.loop(Looper.java:203) at android.app.ActivityThread.main(ActivityThread.java:6251) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1075) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)