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

Commit cb923d99 authored by Chet Haase's avatar Chet Haase
Browse files

null-check before derefing title in MenuItemImpl

The toString() method in MenuItemImpl returns mTitle.toString(),
which crashes when the title is null (which it can be, since there
is no requirement that a title be non-null, and you can get one
by simply not assigning a title to begin with or by setting it
to null).

Issue #13420311 MenuItemImpl can't handle a null title

Change-Id: I701d1d565f1d254ffdd41ca64c1abaf2906edb79
parent a70d1d99
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -496,7 +496,7 @@ public final class MenuItemImpl implements MenuItem {
    
    @Override
    public String toString() {
        return mTitle.toString();
        return mTitle != null ? mTitle.toString() : null;
    }

    void setMenuInfo(ContextMenuInfo menuInfo) {