Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a2f79c8 authored by zhuw's avatar zhuw
Browse files

Fix monkey nullpointer crash when getEditor in panel

add nullpointer check for all editors got from FilterShowActivity

Change-Id: I183fc5ace1536de0e3a897ab9a0e8e32d62c494e
CRs-Fixed: 2087676
parent da299f0a
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -105,7 +105,9 @@ public class EditorCropPanel extends BasicGeometryPanel {
        mApplyButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (mEditorCrop != null) {
                    mEditorCrop.finalApplyCalled();
                }
                activity.backToMain();
                activity.setActionBar();
            }
@@ -146,7 +148,9 @@ public class EditorCropPanel extends BasicGeometryPanel {
    private void changeSelection(int index) {
        if (index >= 0 && index < mButtons.length) {
            mSelectPosition = index;
            if (mEditorCrop != null) {
                mEditorCrop.changeCropAspect(mCropAspectIds[index]);
            }
            highlightIndex(index);
        }
    }
+3 −1
Original line number Diff line number Diff line
@@ -60,7 +60,9 @@ public class TruePortraitMaskEditorPanel extends Fragment {
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        mMainView = inflater.inflate(R.layout.filtershow_trueportrait_editor_panel, container, false);
        if (mEditor != null) {
            mEditor.setUpEditorUI(mMainView, null);
        }
        return mMainView;
    }

+6 −2
Original line number Diff line number Diff line
@@ -60,7 +60,9 @@ public class TrueScannerPanel extends BasicGeometryPanel {
        if (mTrueScannerEditor == null) {
            mTrueScannerEditor = (TrueScannerEditor) activity.getEditor(TrueScannerEditor.ID);
        }
        if (mTrueScannerEditor != null) {
            mTrueScannerEditor.initCords();
        }
        mExitButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
@@ -72,7 +74,9 @@ public class TrueScannerPanel extends BasicGeometryPanel {
        mApplyButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (mTrueScannerEditor != null) {
                    mTrueScannerEditor.finalApplyCalled();
                }
                activity.backToMain();
                activity.setActionBar();
            }