Prevent crash

pull/172/head
M66B 5 years ago
parent e3ee1cc4b2
commit 1dae4909c4

@ -382,10 +382,13 @@ public class FragmentBase extends Fragment {
@Override
protected void onException(Bundle args, Throwable ex) {
if (ex instanceof RecoverableSecurityException &&
Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
if (ex instanceof RecoverableSecurityException) {
handle((RecoverableSecurityException) ex);
} else if (ex instanceof IllegalArgumentException || ex instanceof FileNotFoundException)
return;
}
if (ex instanceof IllegalArgumentException || ex instanceof FileNotFoundException)
ToastEx.makeText(getContext(), ex.getMessage(), Toast.LENGTH_LONG).show();
else
Log.unexpectedError(getParentFragmentManager(), ex);
@ -461,10 +464,12 @@ public class FragmentBase extends Fragment {
@Override
protected void onException(Bundle args, Throwable ex) {
if (ex instanceof RecoverableSecurityException &&
Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
if (ex instanceof RecoverableSecurityException) {
handle((RecoverableSecurityException) ex);
} else
return;
}
Log.unexpectedError(getParentFragmentManager(), ex);
}
}.execute(this, args, "attachments:save");

Loading…
Cancel
Save