File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,16 @@ export function registerBlockitems() {
2424 registerHelp ( ) ;
2525
2626 // Fix the weights of the builtin options we do use
27- Blockly . ContextMenuRegistry . registry . getItem ( "blockDelete" ) . weight = BlockContextWeight . DeleteBlock ;
28- Blockly . ContextMenuRegistry . registry . getItem ( "blockComment" ) . weight = BlockContextWeight . AddComment ;
27+ // Defensiveness due to action changes in the keyboard navigation plugin.
28+ // Needs revisiting when actions are final.
29+ const blockDelete = Blockly . ContextMenuRegistry . registry . getItem ( "blockDelete" ) ;
30+ if ( blockDelete ) {
31+ blockDelete . weight = BlockContextWeight . DeleteBlock ;
32+ }
33+ const blockComment = Blockly . ContextMenuRegistry . registry . getItem ( "blockComment" ) ;
34+ if ( blockComment ) {
35+ blockComment . weight = BlockContextWeight . AddComment ;
36+ }
2937}
3038
3139/**
You can’t perform that action at this time.
0 commit comments