diff --git a/Listify/app/src/main/java/com/example/listify/CreateListDialogFragment.java b/Listify/app/src/main/java/com/example/listify/CreateListDialogFragment.java index 56e0473..d8b0cec 100644 --- a/Listify/app/src/main/java/com/example/listify/CreateListDialogFragment.java +++ b/Listify/app/src/main/java/com/example/listify/CreateListDialogFragment.java @@ -61,6 +61,9 @@ public class CreateListDialogFragment extends DialogFragment { super.onAttach(context); try { onNewListListener = (OnNewListListener) getTargetFragment(); + if (onNewListListener == null) { + onNewListListener = (OnNewListListener) getActivity(); + } } catch (ClassCastException e) { Log.e("CreateListDialogFragment", "onAttach: ClassCastException: " + e.getMessage()); }