[Scummvm-git-logs] scummvm master -> 8d4ef7234df271d0e18d70dc053ac0936c47788e

criezy criezy at scummvm.org
Thu Aug 26 16:13:11 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
8d4ef7234d GUI: Avoid crash when starting ScummVM with partially corrupted config file


Commit: 8d4ef7234df271d0e18d70dc053ac0936c47788e
    https://github.com/scummvm/scummvm/commit/8d4ef7234df271d0e18d70dc053ac0936c47788e
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-08-26T17:12:55+01:00

Commit Message:
GUI: Avoid crash when starting ScummVM with partially corrupted config file

In my case I had a section where only the gameid was defined and no path.
Obviously this is not valid and I cannot start that game. But this is not
a reason to crash with an unknown "path" key error when starting ScummVM.

Changed paths:
    gui/launcher.cpp


diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 388690afc7..cd1773a9fd 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -295,9 +295,8 @@ void LauncherDialog::updateListing() {
 		}
 
 		if (description.empty()) {
-			String gameid(iter->_value.getVal("gameid"));
-
-			if (gameid.empty())
+			String gameid;
+			if (!iter->_value.tryGetVal("gameid", gameid));
 				gameid = iter->_key;
 
 			description = Common::String::format("Unknown (target %s, gameid %s)", iter->_key.c_str(), gameid.c_str());
@@ -315,8 +314,8 @@ void LauncherDialog::updateListing() {
 		color = ThemeEngine::kFontColorNormal;
 
 		if (scanEntries) {
-			Common::FSNode path(iter->domain->getVal("path"));
-			if (!path.isDirectory()) {
+			Common::String path;
+			if (!iter->domain->tryGetVal("path", path) || !Common::FSNode(path).isDirectory()) {
 				color = ThemeEngine::kFontColorAlternate;
 				// If more conditions which grey out entries are added we should consider
 				// enabling this so that it is easy to spot why a certain game entry cannot




More information about the Scummvm-git-logs mailing list