mirror of
https://github.com/EpicMorg/SteamPathsLib.git
synced 2025-01-29 22:37:54 +03:00
fix catching exception
This commit is contained in:
parent
e33f0b6d12
commit
08659b463b
@ -97,6 +97,7 @@ namespace EpicMorg.SteamPathsLib {
|
||||
}
|
||||
}
|
||||
public static ConfigSteamData GetSteamConfig() {
|
||||
try {
|
||||
var result = new ConfigSteamData();
|
||||
var libraryPaths = new List<string>();
|
||||
|
||||
@ -118,9 +119,13 @@ namespace EpicMorg.SteamPathsLib {
|
||||
result.SteamLibraryFolders = libraryPaths.ToArray();
|
||||
|
||||
return result;
|
||||
} catch (Exception) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static List<LibrarySteamData> GetLibrarySteamDataList() {
|
||||
try {
|
||||
var configData = GetSteamConfig();
|
||||
var result = new List<LibrarySteamData>();
|
||||
|
||||
@ -148,9 +153,13 @@ namespace EpicMorg.SteamPathsLib {
|
||||
}
|
||||
|
||||
return result;
|
||||
} catch (Exception) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static List<SteamAppManifestData> GetAllSteamAppManifestData() {
|
||||
try {
|
||||
var result = new List<SteamAppManifestData>();
|
||||
|
||||
var libraries = GetLibrarySteamDataList();
|
||||
@ -160,8 +169,11 @@ namespace EpicMorg.SteamPathsLib {
|
||||
}
|
||||
|
||||
return result;
|
||||
} catch (Exception) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static SteamAppManifestData GetSteamAppManifestDataById(int appId) => GetAllSteamAppManifestData().FirstOrDefault(appData => appData.AppId == appId);
|
||||
public static SteamAppManifestData GetSteamAppManifestDataById(int appId) => GetAllSteamAppManifestData()?.FirstOrDefault(appData => appData.AppId == appId);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user