From bd5f43c5a1b7a8817705ed3bdf291eeb3821b3b4 Mon Sep 17 00:00:00 2001 From: gered Date: Mon, 1 Apr 2013 17:42:15 -0400 Subject: [PATCH] add if-check for the graphics device object passed to GraphicsContextResource::Initialize() so it can fail gracefully instead of just relying on the assert --- src/framework/graphics/graphicscontextresource.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/framework/graphics/graphicscontextresource.cpp b/src/framework/graphics/graphicscontextresource.cpp index f0f6375..1f56b0c 100644 --- a/src/framework/graphics/graphicscontextresource.cpp +++ b/src/framework/graphics/graphicscontextresource.cpp @@ -28,6 +28,8 @@ BOOL GraphicsContextResource::Initialize(GraphicsDevice *graphicsDevice) { STACK_TRACE; ASSERT(graphicsDevice != NULL); + if (graphicsDevice == NULL) + return FALSE; m_graphicsDevice = graphicsDevice; m_graphicsDevice->RegisterManagedResource(this);