From ad6ce5a726b905dc51ddad93809877b60d72b618 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 9 Nov 2015 13:49:17 +0100 Subject: [PATCH] - added a NULL check to gl_enhanced_nightvision's handler so that it won't crash without an uninitialized GL renderer. --- src/gl/renderer/gl_lightdata.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gl/renderer/gl_lightdata.cpp b/src/gl/renderer/gl_lightdata.cpp index 1e5922d0a8..5d153894fc 100644 --- a/src/gl/renderer/gl_lightdata.cpp +++ b/src/gl/renderer/gl_lightdata.cpp @@ -71,7 +71,10 @@ CUSTOM_CVAR(Bool, gl_enhanced_nightvision, true, CVAR_ARCHIVE|CVAR_NOINITCALL) { // The fixed colormap state needs to be reset because if this happens when // a shader is set to CM_LITE or CM_TORCH it won't register the change in behavior caused by this CVAR. - GLRenderer->mShaderManager->ResetFixedColormap(); + if (GLRenderer != NULL && GLRenderer->mShaderManager != NULL) + { + GLRenderer->mShaderManager->ResetFixedColormap(); + } } CVAR(Bool, gl_brightfog, false, CVAR_ARCHIVE);