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:
parent
4db24ae39a
commit
bd5f43c5a1
|
@ -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);
|
||||||
|
|
Reference in a new issue