care for nil icons.
authorClaus Gittinger <cg@exept.de>
Wed, 05 Oct 2005 17:45:36 +0200
changeset 6390 5165b2d373d9
parent 6389 9f4010737320
child 6391 17dba1745e61
care for nil icons.
FileBrowser.st
--- a/FileBrowser.st	Wed Oct 05 13:37:37 2005 +0200
+++ b/FileBrowser.st	Wed Oct 05 17:45:36 2005 +0200
@@ -244,18 +244,21 @@
 addOnIconsFor:aFilename to:anIcon
     "given a fileName, return an appropriate icon"
 
-    | addIcns isDirectory isReadable|
+    |addOnIcon addIcns isDirectory isReadable|
 
     aFilename isNil ifTrue:[^ anIcon ].
+    anIcon isNil ifTrue:[^ anIcon ].
 
     addIcns := OrderedCollection new.
     aFilename isSymbolicLink ifTrue:[
-        addIcns add:(self iconForKeyMatching:#addOnLinked).
+        addOnIcon := self iconForKeyMatching:#addOnLinked.
+        addOnIcon notNil ifTrue:[ addIcns add:addOnIcon ].
     ].
     isDirectory := aFilename isDirectory.
     isReadable := aFilename isReadable.
     ((isReadable not and:[isDirectory not]) or:[(isDirectory) and:[(isReadable not) or:[aFilename isExecutable not]]]) ifTrue:[
-        addIcns add:(self iconForKeyMatching:#addOnLocked).
+        addOnIcon := self iconForKeyMatching:#addOnLocked.
+        addOnIcon notNil ifTrue:[ addIcns add:addOnIcon ].
     ].
     addIcns notEmpty ifTrue:[
         addIcns addFirst:anIcon.
@@ -7514,5 +7517,5 @@
 !FileBrowser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.604 2005-07-13 15:53:02 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.605 2005-10-05 15:45:36 cg Exp $'
 ! !