Prevent crash

This commit is contained in:
M66B 2020-04-30 15:31:43 +02:00
parent 96a94a6c94
commit 3114889282
1 changed files with 3 additions and 1 deletions

View File

@ -148,7 +148,9 @@ public class FragmentDialogBase extends DialogFragment {
once = true;
Fragment target = getTargetFragment();
Log.i("Dialog target=" + target + " result=" + result);
if (target != null) {
if (target != null &&
target.getView() != null &&
target.getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) {
Intent data = new Intent();
data.putExtra("args", getArguments());
target.onActivityResult(getTargetRequestCode(), result, data);