Prevent crash

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

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

Loading…
Cancel
Save