Fix possible crash

This commit is contained in:
JustArchi 2017-02-02 14:04:34 +01:00
parent 7d0d370330
commit b1ff0a34db

View file

@ -1754,7 +1754,16 @@ namespace ArchiSteamFarm {
StringBuilder response = new StringBuilder();
foreach (uint gameID in gameIDs) {
SteamApps.FreeLicenseCallback callback = await SteamApps.RequestFreeLicense(gameID);
SteamApps.FreeLicenseCallback callback;
try {
callback = await SteamApps.RequestFreeLicense(gameID);
} catch (Exception e) {
ArchiLogger.LogGenericException(e);
response.Append(Environment.NewLine + string.Format(Strings.BotAddLicenseResponse, BotName, gameID, EResult.Timeout));
break;
}
if (callback == null) {
response.Append(Environment.NewLine + string.Format(Strings.BotAddLicenseResponse, BotName, gameID, EResult.Timeout));
break;