std::string constructor doesn't like null pointers

This commit is contained in:
Jonas Kulla 2014-12-23 20:19:28 +01:00
parent 4560589e25
commit 0a484c8a31
1 changed files with 4 additions and 0 deletions

View File

@ -123,6 +123,10 @@ static bool validUtf8(const char *string)
static std::string prefPath(const char *org, const char *app)
{
char *path = SDL_GetPrefPath(org, app);
if (!path)
return std::string();
std::string str(path);
SDL_free(path);