Skip to content

Commit

Permalink
fix crash when loading certain invalid powder.prefs
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob1 committed Jan 22, 2017
1 parent 4b7288e commit 76d29b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/misc.cpp
Expand Up @@ -485,7 +485,7 @@ void load_presets(void)
if (mode == 0)
{
char * strMode = tempDisplayMode->valuestring;
if (strlen(strMode))
if (strMode && strlen(strMode))
mode = atoi(strMode);
}
Renderer::Ref().AddDisplayMode(mode);
Expand All @@ -504,7 +504,7 @@ void load_presets(void)
if (mode == 0)
{
char * strMode = tempRenderMode->valuestring;
if (strlen(strMode))
if (strMode && strlen(strMode))
mode = atoi(strMode);
}
// temporary hack until I update the json library (first for loading current modes, second only needed for loading with valuestring)
Expand Down

0 comments on commit 76d29b4

Please sign in to comment.