File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ bool MenuDelegate::IsCommandIdEnabled(int command_id) const {
47
47
return false ;
48
48
49
49
MenuItem* item = dispatcher_host_->GetApiObject <MenuItem>(command_id);
50
+ if (!item)
51
+ return false ;
50
52
return item->is_enabled_ ;
51
53
}
52
54
@@ -55,6 +57,8 @@ bool MenuDelegate::IsItemForCommandIdDynamic(int command_id) const {
55
57
return false ;
56
58
57
59
MenuItem* item = dispatcher_host_->GetApiObject <MenuItem>(command_id);
60
+ if (!item)
61
+ return false ;
58
62
return item->is_modified_ ;
59
63
}
60
64
@@ -66,6 +70,8 @@ string16 MenuDelegate::GetLabelForCommandId(int command_id) const {
66
70
bool MenuDelegate::GetIconForCommandId (int command_id,
67
71
gfx::Image* icon) const {
68
72
MenuItem* item = dispatcher_host_->GetApiObject <MenuItem>(command_id);
73
+ if (!item)
74
+ return false ;
69
75
if (item->icon_ .IsEmpty ())
70
76
return false ;
71
77
@@ -78,6 +84,8 @@ void MenuDelegate::ExecuteCommand(int command_id, int event_flags) {
78
84
return ;
79
85
80
86
MenuItem* item = dispatcher_host_->GetApiObject <MenuItem>(command_id);
87
+ if (!item)
88
+ return ;
81
89
item->OnClick ();
82
90
}
83
91
@@ -86,6 +94,8 @@ bool MenuDelegate::HasIcon(int command_id) {
86
94
return false ;
87
95
88
96
MenuItem* item = dispatcher_host_->GetApiObject <MenuItem>(command_id);
97
+ if (!item)
98
+ return false ;
89
99
return !item->icon_ .IsEmpty ();
90
100
}
91
101
You can’t perform that action at this time.
0 commit comments