mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-01 06:38:29 +02:00
Prevent crash
This commit is contained in:
@@ -1190,9 +1190,7 @@ public class Log {
|
||||
final Throwable ex = (Throwable) getArguments().getSerializable("ex");
|
||||
boolean report = getArguments().getBoolean("report", true);
|
||||
|
||||
final Context context = getContext();
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context)
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getContext())
|
||||
.setTitle(R.string.title_unexpected_error)
|
||||
.setMessage(Log.formatThrowable(ex, false))
|
||||
.setPositiveButton(android.R.string.cancel, null);
|
||||
@@ -1201,6 +1199,9 @@ public class Log {
|
||||
builder.setNeutralButton(R.string.title_report, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
// Dialog will be dismissed
|
||||
final Context context = getContext();
|
||||
|
||||
new SimpleTask<Long>() {
|
||||
@Override
|
||||
protected Long onExecute(Context context, Bundle args) throws Throwable {
|
||||
@@ -1221,7 +1222,7 @@ public class Log {
|
||||
else
|
||||
ToastEx.makeText(context, ex.toString(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}.execute(context, getActivity(), new Bundle(), "error:unexpected");
|
||||
}.execute(getContext(), getActivity(), new Bundle(), "error:unexpected");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user