Fix NPE in child fragments
This commit is contained in:
parent
a6bffe42d6
commit
7a1bbb1b7a
1 changed files with 7 additions and 5 deletions
|
@ -44,6 +44,7 @@ public class MapMarkersDialogFragment extends android.support.v4.app.DialogFragm
|
|||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
|
||||
List<Fragment> fragments = getChildFragmentManager().getFragments();
|
||||
if (fragments != null) {
|
||||
for (Fragment fragment : fragments) {
|
||||
if (fragment instanceof MapMarkersActiveFragment) {
|
||||
activeFragment = (MapMarkersActiveFragment) fragment;
|
||||
|
@ -51,6 +52,7 @@ public class MapMarkersDialogFragment extends android.support.v4.app.DialogFragm
|
|||
historyFragment = (MapMarkersHistoryFragment) fragment;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (activeFragment == null) {
|
||||
activeFragment = new MapMarkersActiveFragment();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue