add if-check for the graphics device object passed to GraphicsContextResource::Initialize() so it can fail gracefully instead of just relying on the assert

This commit is contained in:
Gered 2013-04-01 17:42:15 -04:00
parent 4db24ae39a
commit bd5f43c5a1

View file

@ -28,6 +28,8 @@ BOOL GraphicsContextResource::Initialize(GraphicsDevice *graphicsDevice)
{ {
STACK_TRACE; STACK_TRACE;
ASSERT(graphicsDevice != NULL); ASSERT(graphicsDevice != NULL);
if (graphicsDevice == NULL)
return FALSE;
m_graphicsDevice = graphicsDevice; m_graphicsDevice = graphicsDevice;
m_graphicsDevice->RegisterManagedResource(this); m_graphicsDevice->RegisterManagedResource(this);