#BUGFIX by exept
authorClaus Gittinger <cg@exept.de>
Fri, 11 Oct 2019 10:19:39 +0200
changeset 8821 e1cf05178432
parent 8820 5a37b028d60c
child 8822 e03526cdc975
#BUGFIX by exept class: Form changed: #asImageForm
Form.st
--- a/Form.st	Fri Oct 11 08:54:12 2019 +0200
+++ b/Form.st	Fri Oct 11 10:19:39 2019 +0200
@@ -1162,17 +1162,17 @@
 asImageForm
     "convert & return the receiver into a ImageForm instance"
 
-    |imageForm|
+    |imageForm lobby|
 
     imageForm := ImageForm cloneFrom:self.
 
     "kludge: have to unregister. Otherwise the form will be destroyed when
      we are garbage collected"
 
-    gc finalizationLobby
-	unregister:gc;
-	registerChange:imageForm graphicsContext.
-
+    (lobby := gc finalizationLobby) notNil ifTrue:[
+        lobby unregister:gc.
+        lobby registerChange:imageForm graphicsContext.
+    ].
     ^ imageForm.
 ! !