Fix IllegalStateException (#1585)
Fragment may have detached and does not have parent fragment manager
This commit is contained in:
parent
b4eed403e4
commit
8e6fba6852
|
|
@ -100,11 +100,12 @@ public class CompileDialogFragment extends AppCompatDialogFragment {
|
||||||
if (result instanceof UnknownError) {
|
if (result instanceof UnknownError) {
|
||||||
text = context.getString(R.string.compile_failed);
|
text = context.getString(R.string.compile_failed);
|
||||||
} else {
|
} else {
|
||||||
text = context.getString(R.string.compile_failed_with_info) + result.toString();
|
text = context.getString(R.string.compile_failed_with_info) + result;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
text = context.getString(R.string.compile_done);
|
text = context.getString(R.string.compile_done);
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
CompileDialogFragment fragment = outerRef.get();
|
CompileDialogFragment fragment = outerRef.get();
|
||||||
if (fragment != null) {
|
if (fragment != null) {
|
||||||
fragment.dismissAllowingStateLoss();
|
fragment.dismissAllowingStateLoss();
|
||||||
|
|
@ -113,6 +114,8 @@ public class CompileDialogFragment extends AppCompatDialogFragment {
|
||||||
((BaseFragment) parent).showHint(text, true);
|
((BaseFragment) parent).showHint(text, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (IllegalStateException ignored) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue