Browse Source

Fixed null pointer thingy

Josh Yelon 19 years ago
parent
commit
55e11a329a
1 changed files with 5 additions and 3 deletions
  1. 5 3
      panda/src/osxdisplay/osxGraphicsPipe.cxx

+ 5 - 3
panda/src/osxdisplay/osxGraphicsPipe.cxx

@@ -85,9 +85,11 @@ make_output(const string &name,
     return NULL;
     return NULL;
   }
   }
   
   
-  osxGraphicsStateGuardian *osxgsg;
-  DCAST_INTO_R(osxgsg, gsg, NULL);
-
+  osxGraphicsStateGuardian *osxgsg = 0;
+  if (gsg != 0) {
+    DCAST_INTO_R(osxgsg, gsg, NULL);
+  }
+  
   // First thing to try: a osxGraphicsWindow
   // First thing to try: a osxGraphicsWindow
 
 
   if (retry == 0) {
   if (retry == 0) {