Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Commit 5d821c0

Browse files
committed
Added some checks addressing review comments.
1 parent db7e018 commit 5d821c0

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

appshell/appshell_extensions_gtk.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,8 +1123,17 @@ int32 SetMenuItemState(CefRefPtr<CefBrowser> browser, ExtensionString command, b
11231123
return ERR_NOT_FOUND;
11241124
}
11251125
GtkWidget* menuItem = (GtkWidget*) model.getOsItem(tag);
1126+
if (menuItem == NULL) {
1127+
return ERR_UNKNOWN;
1128+
}
11261129
GtkWidget* parent = gtk_widget_get_parent(menuItem);
1130+
if (parent == NULL) {
1131+
return ERR_UNKNOWN;
1132+
}
11271133
int position = _getMenuItemPosition(parent, menuItem);
1134+
if (position < 0) {
1135+
return ERR_UNKNOWN;
1136+
}
11281137
const gchar* label = gtk_menu_item_get_label(GTK_MENU_ITEM(menuItem));
11291138

11301139
GtkWidget* newMenuItem;

0 commit comments

Comments
 (0)