be tolerant if form creation fails
authorClaus Gittinger <cg@exept.de>
Wed, 27 Dec 1995 17:19:59 +0100
changeset 337 15deeed5ac81
parent 336 fa55b8596c8c
child 338 0730535e90f7
be tolerant if form creation fails
Depth1Image.st
--- a/Depth1Image.st	Tue Dec 26 19:18:24 1995 +0100
+++ b/Depth1Image.st	Wed Dec 27 17:19:59 1995 +0100
@@ -232,10 +232,12 @@
     |f|
 
     f := Form width:width height:height fromArray:bytes on:aDevice.
-    photometric == #blackIs0 ifTrue:[
-	f function:#xor.
-	f paint:(Color colorId:1).
-	f fillRectangleX:0 y:0 width:width height:height
+    f notNil ifTrue:[
+        photometric == #blackIs0 ifTrue:[
+	    f function:#xor.
+	    f paint:(Color colorId:1).
+	    f fillRectangleX:0 y:0 width:width height:height
+	]
     ].
     ^ f
 !
@@ -257,7 +259,9 @@
      this is easy, since Form already supports colorMaps
     "
     f := Form width:width height:height fromArray:bytes.
-    f colorMap:colorMap.
+    f notNil ifTrue:[
+        f colorMap:colorMap.
+    ].
     ^ f
 !
 
@@ -560,5 +564,5 @@
 !Depth1Image class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Depth1Image.st,v 1.16 1995-12-14 20:13:45 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Depth1Image.st,v 1.17 1995-12-27 16:19:59 cg Exp $'
 ! !