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

Commit d25225ad authored by Kiet Le Chi's avatar Kiet Le Chi Committed by Steve Kondik
Browse files

Check the parent for null in edit_delete

There is a reproducible error in Contacts when the delete
action is triggered more than once and thereby crashing the
app that is fixed by addeding a null check of parent.

Also preventing the mListener.onDeleted from getting mutiple
callbacks.

Change-Id: I6de29ed0139a5fb377a845da3194475b02a86ee3
parent 7241445c
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -385,12 +385,13 @@ public class GenericEditorView extends RelativeLayout implements Editor, View.On

                // Remove editor from parent view
                final ViewGroup parent = (ViewGroup)getParent();
                if (parent != null) {
                    parent.removeView(this);

                    if (mListener != null) {
                        // Notify listener when present
                        mListener.onDeleted(this);
                    }
                }
                break;
            }
            case R.id.edit_more: