#BUGFIX by cg
authorClaus Gittinger <cg@exept.de>
Mon, 15 Oct 2018 10:53:02 +0200
changeset 8516 78145b187ac5
parent 8515 df48500ea37b
child 8517 b32d1a4a3c24
#BUGFIX by cg class: ResourcePack changed: #at:ifAbsent: #whichPackIncludesKey:
ResourcePack.st
--- a/ResourcePack.st	Mon Oct 15 02:50:06 2018 +0200
+++ b/ResourcePack.st	Mon Oct 15 10:53:02 2018 +0200
@@ -823,7 +823,7 @@
 at:aKey ifAbsent:defaultValue
     "translate a string; search here, in my projects pack and in my superpack(s)"
 
-    |val pack projectPack alreadySearched toSearch|
+    |val pack projectPack alreadySearched toSearch more|
 
     aKey isNil ifTrue:[ ^ defaultValue value ].
 
@@ -835,7 +835,7 @@
         ^ val
     ].
     
-    superPacks notNil ifTrue:[
+    superPacks notEmptyOrNil ifTrue:[
         alreadySearched := Set new.
         toSearch := OrderedCollection withAll:superPacks.
         [toSearch notEmpty] whileTrue:[
@@ -847,8 +847,10 @@
                     ^ val
                 ].
                 alreadySearched add:pack.
-                self assert:(pack superPacks conform:[:each | each isNil or:[pack isKindOf:ResourcePack]]).
-                toSearch addAll:(pack superPacks).
+                (more := pack superPacks) notEmptyOrNil ifTrue:[
+                    self assert:(more conform:[:each | each isNil or:[pack isKindOf:ResourcePack]]).
+                    toSearch addAll:more.
+                ].
             ].
         ].
     ].
@@ -1355,7 +1357,7 @@
     val := self localAt:aKey.
     val notNil ifTrue:[^ self].
 
-    superPacks isNil ifTrue:[^ nil].
+    superPacks isEmptyOrNil ifTrue:[^ nil].
 
     alreadySearched := Set new.
     toSearch := OrderedCollection withAll:superPacks.