 
 
 (defn clear-intermed-bitmap [^org.turtle.geometry.TurtleGraphics this]
-  (.drawColor ^Canvas (get-in @this [:draw-state :draw-canvas]) Color/WHITE))
+  (when-let [intermed-bitmap (get-in @this [:draw-state :draw-canvas])]
+    (.drawColor ^Canvas intermed-bitmap Color/WHITE)))
 
 (defn -surfaceChanged [^org.turtle.geometry.TurtleGraphics this
                        ^SurfaceHolder holder

                 (.runOnUiThread
                  activity
                  (fn []
                    (report-error activity "Interrupted"))))
               (catch Exception e
                 (.runOnUiThread
                  activity

           [android.util AttributeSet]
           [android.util.Log]

           [java.io BufferedWriter BufferedReader
            File FileReader FileWriter StringWriter]
           [java.util.concurrent
            ConcurrentLinkedQueue
            LinkedBlockingQueue
