浏览代码

Fixed null pointer thingy

Josh Yelon 19 年之前
父节点
当前提交
55e11a329a
共有 1 个文件被更改,包括 5 次插入3 次删除
  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;
   }
   
-  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
 
   if (retry == 0) {