From 0a484c8a31b3a8f292b9cf309df8881dad234d07 Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Tue, 23 Dec 2014 20:19:28 +0100 Subject: [PATCH] std::string constructor doesn't like null pointers --- src/config.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/config.cpp b/src/config.cpp index 160e66b..f4fbb34 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -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);