extensions.st
changeset 1145 a79c30ec56ec
parent 1143 66b5c959cee1
--- a/extensions.st	Wed Aug 24 15:40:14 2022 +0100
+++ b/extensions.st	Thu Sep 01 22:58:08 2022 +0100
@@ -812,24 +812,29 @@
 
     <swizzle: #askForMethodCategory:title:okLabel:list:recentList:initialAnswer:>
 
-    | dialog |
+    | dialog classes |
 
     UserPreferences current smallSenseNewDialogsEnabled ifFalse:[ 
         ^ self stx_libtool_askForMethodCategory:question title:boxTitle okLabel:okLabel list:someCategories recentList:recentListOrNil initialAnswer:initialText     
     ].
+
+    classes := self selectedClasses value.
+
     dialog := SmallSense::ProtocolSelectDialog new.   
     dialog title: (resources string: question).
     dialog addButtonCancel.   
     dialog addButtonAcceptWithLabel: (resources string: okLabel).  
-    dialog protocolsToHighlight: (Iterator on:[ :whatToDo |
-        self selectedClasses value do:[:each | 
-            each withAllSuperclassesDo:[ :cls |
-                cls methodDictionary do:[:method | 
-                    whatToDo value: method category.
-                ]
+    classes notNil ifTrue:[
+        dialog protocolsToHighlight: (Iterator on:[ :whatToDo |
+            classes do:[:each | 
+                each withAllSuperclassesDo:[ :cls |
+                    cls methodDictionary do:[:method | 
+                        whatToDo value: method category.
+                    ]
+                ].
             ].
-        ].
-    ]).
+        ]).
+    ].
     initialText notNil ifTrue:[ 
         dialog pattern: initialText.
         dialog selection: initialText. 
@@ -841,6 +846,7 @@
 
     "Created: / 09-01-2015 / 10:44:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 17-08-2016 / 16:01:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 01-09-2022 / 21:24:29 / Jan Vrany <jan.vrany@labware.com>"
 ! !
 
 !Tools::NewSystemBrowser methodsFor:'menu actions-category-SmallSense'!