[app] Fix a crash (#1005)

This commit is contained in:
tehcneko 2021-08-25 21:52:26 +08:00 committed by GitHub
parent 0eb7d9c57b
commit 6000b68f75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -130,8 +130,9 @@ public class RepoFragment extends BaseFragment implements RepoLoader.Listener {
super.onResume();
adapter.initData();
if (preLoadWebview) {
new Handler(Looper.getMainLooper()).postDelayed(() ->
new WebView(RepoFragment.this.requireContext()), 500);
new Handler(Looper.getMainLooper()).postDelayed(() -> {
if (!isRemoving()) new WebView(requireContext());
}, 500);
preLoadWebview = false;
}
}