Merge "Fix NPE in PanelFragment"

This commit is contained in:
Treehugger Robot
2020-03-02 11:21:05 +00:00
committed by Gerrit Code Review

View File

@@ -144,8 +144,13 @@ public class PanelFragment extends Fragment {
private void createPanelContent() { private void createPanelContent() {
final FragmentActivity activity = getActivity(); final FragmentActivity activity = getActivity();
if (activity == null) {
return;
}
if (mLayoutView == null) { if (mLayoutView == null) {
activity.finish(); activity.finish();
return;
} }
mPanelSlices = mLayoutView.findViewById(R.id.panel_parent_layout); mPanelSlices = mLayoutView.findViewById(R.id.panel_parent_layout);
@@ -172,6 +177,7 @@ public class PanelFragment extends Fragment {
if (mPanel == null) { if (mPanel == null) {
activity.finish(); activity.finish();
return;
} }
mMetricsProvider = FeatureFactory.getFactory(activity).getMetricsFeatureProvider(); mMetricsProvider = FeatureFactory.getFactory(activity).getMetricsFeatureProvider();