Browse Source

don't crash if window not opened

David Rose 22 years ago
parent
commit
3e8f0ebac2
1 changed files with 3 additions and 2 deletions
  1. 3 2
      direct/src/showbase/ShowBase.py

+ 3 - 2
direct/src/showbase/ShowBase.py

@@ -988,8 +988,9 @@ class ShowBase(DirectObject.DirectObject):
             color = VBase4(arg[0], arg[1], arg[2], 1.0)
         else:
             raise TypeError, ('Invalid number of arguments: %d, expected 1, 3, or 4.' % numArgs)
-            
-        self.win.setClearColor(color)
+
+        if self.win:
+            self.win.setClearColor(color)
                 
     def toggleBackface(self):
         if self.backfaceCullingEnabled: