From 55e11a329a992f4bdece1bd2a04dfd4ac2f2793f Mon Sep 17 00:00:00 2001 From: Josh Yelon Date: Fri, 9 Jun 2006 17:41:09 +0000 Subject: [PATCH] Fixed null pointer thingy --- panda/src/osxdisplay/osxGraphicsPipe.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/panda/src/osxdisplay/osxGraphicsPipe.cxx b/panda/src/osxdisplay/osxGraphicsPipe.cxx index b659f40c43..dde22bbad8 100644 --- a/panda/src/osxdisplay/osxGraphicsPipe.cxx +++ b/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) {