prevent Steam vdf read errors from crashing the installer
This commit is contained in:
parent
4e91174b3e
commit
0e4dd8a7b4
|
@ -8,6 +8,9 @@
|
||||||
-->
|
-->
|
||||||
|
|
||||||
## Upcoming release
|
## Upcoming release
|
||||||
|
* For players:
|
||||||
|
* Fixed installer crash if Steam's library data is invalid or in an old format; it'll now be ignored instead.
|
||||||
|
|
||||||
* For mod authors:
|
* For mod authors:
|
||||||
* Fixed image patches sometimes applied one pixel higher than expected after 3.17.0 (thanks to atravita!).
|
* Fixed image patches sometimes applied one pixel higher than expected after 3.17.0 (thanks to atravita!).
|
||||||
|
|
||||||
|
|
|
@ -260,6 +260,8 @@ namespace StardewModdingAPI.Toolkit.Framework.GameScanning
|
||||||
/// <param name="steamPath">The full path to the directory containing steam.exe.</param>
|
/// <param name="steamPath">The full path to the directory containing steam.exe.</param>
|
||||||
/// <returns>The game directory, if found.</returns>
|
/// <returns>The game directory, if found.</returns>
|
||||||
private string? GetPathFromSteamLibrary(string? steamPath)
|
private string? GetPathFromSteamLibrary(string? steamPath)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (steamPath == null)
|
if (steamPath == null)
|
||||||
return null;
|
return null;
|
||||||
|
@ -295,6 +297,15 @@ namespace StardewModdingAPI.Toolkit.Framework.GameScanning
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// The file might not be parseable in some cases (e.g. some players have an older Steam version using
|
||||||
|
// a different format). Ideally we'd log an error to know when it's actually an issue, but the SMAPI
|
||||||
|
// installer doesn't have a logging mechanism (and third-party code calling the toolkit may not either).
|
||||||
|
// So for now, just ignore the error and fallback to the other discovery mechanisms.
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue