BASE: Improve error handling when detecting games
This commit is contained in:
parent
5d91efa74d
commit
ae8944e104
1 changed files with 6 additions and 2 deletions
|
@ -810,7 +810,10 @@ static GameList getGameList(Common::String path) {
|
||||||
Common::FSList files;
|
Common::FSList files;
|
||||||
|
|
||||||
//Collect all files from directory
|
//Collect all files from directory
|
||||||
dir.getChildren(files, Common::FSNode::kListAll);
|
if (!dir.getChildren(files, Common::FSNode::kListAll)) {
|
||||||
|
printf("Path %s does not exist or is not a directory.\n", path.c_str());
|
||||||
|
return GameList();
|
||||||
|
}
|
||||||
|
|
||||||
// detect Games
|
// detect Games
|
||||||
GameList candidates(EngineMan.detectGames(files));
|
GameList candidates(EngineMan.detectGames(files));
|
||||||
|
@ -928,7 +931,8 @@ static bool massAddGame(Common::String path) {
|
||||||
Common::String dataPath = dir.getPath();
|
Common::String dataPath = dir.getPath();
|
||||||
|
|
||||||
//Collect all files from directory
|
//Collect all files from directory
|
||||||
dir.getChildren(files, Common::FSNode::kListAll);
|
if (!dir.getChildren(files, Common::FSNode::kListAll))
|
||||||
|
continue;
|
||||||
|
|
||||||
// Get game list and add games
|
// Get game list and add games
|
||||||
GameList candidates(EngineMan.detectGames(files));
|
GameList candidates(EngineMan.detectGames(files));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue