Fixed InstallFolder exception

This folder does not always exist.
This commit is contained in:
Phyxion 2017-09-05 13:29:07 +02:00 committed by GitHub
parent 1cf2130703
commit 72bae11073

View File

@ -114,7 +114,8 @@ public Client( uint appId )
SteamId = native.user.GetSteamID(); SteamId = native.user.GetSteamID();
BetaName = native.apps.GetCurrentBetaName(); BetaName = native.apps.GetCurrentBetaName();
OwnerSteamId = native.apps.GetAppOwner(); OwnerSteamId = native.apps.GetAppOwner();
InstallFolder = new DirectoryInfo( native.apps.GetAppInstallDir( AppId ) ); if (!String.IsNullOrEmpty(native.apps.GetAppInstallDir(AppId)) && Directory.Exists(native.apps.GetAppInstallDir(AppId)))
InstallFolder = new DirectoryInfo( native.apps.GetAppInstallDir( AppId ) );
BuildId = native.apps.GetAppBuildId(); BuildId = native.apps.GetAppBuildId();
CurrentLanguage = native.apps.GetCurrentGameLanguage(); CurrentLanguage = native.apps.GetCurrentGameLanguage();
AvailableLanguages = native.apps.GetAvailableGameLanguages().Split( new[] {';'}, StringSplitOptions.RemoveEmptyEntries ); // TODO: Assumed colon separated AvailableLanguages = native.apps.GetAvailableGameLanguages().Split( new[] {';'}, StringSplitOptions.RemoveEmptyEntries ); // TODO: Assumed colon separated