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

Commit

Permalink
Added some checks addressing review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
pelatx committed Mar 8, 2018
1 parent db7e018 commit 5d821c0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions appshell/appshell_extensions_gtk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1123,8 +1123,17 @@ int32 SetMenuItemState(CefRefPtr<CefBrowser> browser, ExtensionString command, b
return ERR_NOT_FOUND;
}
GtkWidget* menuItem = (GtkWidget*) model.getOsItem(tag);
if (menuItem == NULL) {
return ERR_UNKNOWN;
}
GtkWidget* parent = gtk_widget_get_parent(menuItem);
if (parent == NULL) {
return ERR_UNKNOWN;
}
int position = _getMenuItemPosition(parent, menuItem);
if (position < 0) {
return ERR_UNKNOWN;
}
const gchar* label = gtk_menu_item_get_label(GTK_MENU_ITEM(menuItem));

GtkWidget* newMenuItem;
Expand Down

0 comments on commit 5d821c0

Please sign in to comment.