File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ Browser.commands.onCommand.addListener(async (command) => {
159
159
useMenuPosition : false ,
160
160
}
161
161
console . debug ( 'command triggered' , message )
162
- if ( menuConfig [ command ] . action ) menuConfig [ command ] . action ( )
162
+ if ( command in menuConfig && menuConfig [ command ] . action ) menuConfig [ command ] . action ( )
163
163
Browser . tabs . sendMessage ( currentTab . id , {
164
164
type : 'CREATE_CHAT' ,
165
165
data : message ,
@@ -212,7 +212,8 @@ function refreshMenu() {
212
212
useMenuPosition : tab . id === currentTab . id ,
213
213
}
214
214
console . debug ( 'menu clicked' , message )
215
- if ( menuConfig [ message . itemId ] . action ) menuConfig [ message . itemId ] . action ( )
215
+ if ( message . itemId in menuConfig && menuConfig [ message . itemId ] . action )
216
+ menuConfig [ message . itemId ] . action ( )
216
217
Browser . tabs . sendMessage ( currentTab . id , {
217
218
type : 'CREATE_CHAT' ,
218
219
data : message ,
You can’t perform that action at this time.
0 commit comments