diff options
author | Eugene Sandulenko | 2006-04-04 23:30:41 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2006-04-04 23:30:41 +0000 |
commit | 607ae0bab606f591615b3858fe25b3dec8cf666b (patch) | |
tree | e3f21c59efb85c5a195e93cf046518e867a867a0 /base | |
parent | 15f4249978fcfb71a71bf750c44804ac6ea2fc74 (diff) | |
download | scummvm-rg350-607ae0bab606f591615b3858fe25b3dec8cf666b.tar.gz scummvm-rg350-607ae0bab606f591615b3858fe25b3dec8cf666b.tar.bz2 scummvm-rg350-607ae0bab606f591615b3858fe25b3dec8cf666b.zip |
Fix crash for a case when game path is set incorrectly
svn-id: r21614
Diffstat (limited to 'base')
-rw-r--r-- | base/main.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/base/main.cpp b/base/main.cpp index b2b6c7be80..af45630a2c 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -244,7 +244,10 @@ static bool launcherDialog(GameDetector &detector, OSystem &system) { static int runGame(GameDetector &detector, OSystem &system, const Common::String &edebuglevels) { // We add it here, so MD5-based detection will be able to // read mixed case files - Common::File::addDefaultDirectory(ConfMan.get("path")); + if (ConfMan.hasKey("path")) + Common::File::addDefaultDirectory(ConfMan.get("path")); + else + Common::File::addDefaultDirectory("."); // Create the game engine Engine *engine = detector.createEngine(&system); @@ -271,7 +274,10 @@ static int runGame(GameDetector &detector, OSystem &system, const Common::String system.setWindowCaption(caption.c_str()); } - Common::File::addDefaultDirectoryRecursive(ConfMan.get("path")); + if (ConfMan.hasKey("path")) + Common::File::addDefaultDirectoryRecursive(ConfMan.get("path")); + else + Common::File::addDefaultDirectoryRecursive("."); // Add extrapath (if any) to the directory search list if (ConfMan.hasKey("extrapath")) |