summaryrefslogtreecommitdiff
path: root/src/utils/paths.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/paths.cpp')
-rw-r--r--src/utils/paths.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/utils/paths.cpp b/src/utils/paths.cpp
index 3cc35cb55..8decb6e95 100644
--- a/src/utils/paths.cpp
+++ b/src/utils/paths.cpp
@@ -1,6 +1,6 @@
/*
* The ManaPlus Client
- * Copyright (C) 2011 The ManaPlus Developers
+ * Copyright (C) 2011-2012 The ManaPlus Developers
*
* This file is part of The ManaPlus Client.
*
@@ -43,6 +43,8 @@ std::string getRealPath(const std::string &str)
#else
char *realPath = realpath(str.c_str(), nullptr);
#endif
+ if (!realPath)
+ return "";
path = realPath;
free(realPath);
return path;