diff --git a/code/renderer/tr_shader.c b/code/renderer/tr_shader.c index 75563d93..158f81a1 100644 --- a/code/renderer/tr_shader.c +++ b/code/renderer/tr_shader.c @@ -2327,14 +2327,15 @@ static char *FindShaderInShaderText( const char *shadername ) { hash = generateHashValue(shadername, MAX_SHADERTEXT_HASH); - if(!shaderTextHashTable[hash]) - return NULL; - - for (i = 0; shaderTextHashTable[hash][i]; i++) { - p = shaderTextHashTable[hash][i]; - token = COM_ParseExt(&p, qtrue); - if ( !Q_stricmp( token, shadername ) ) { - return p; + if(shaderTextHashTable[hash]) + { + for (i = 0; shaderTextHashTable[hash][i]; i++) + { + p = shaderTextHashTable[hash][i]; + token = COM_ParseExt(&p, qtrue); + + if(!Q_stricmp(token, shadername)) + return p; } }