#BUGFIX by cg
class: ResourcePack
changed:
#at:ifAbsent:
#whichPackIncludesKey:
--- 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.