diff options
| author | Andrew Rabert <6550543+nvllsvm@users.noreply.github.com> | 2019-01-27 14:04:39 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-27 14:04:39 -0500 |
| commit | b4893b9ac90ea19eb65888d87e73ca260067a999 (patch) | |
| tree | d5d25a931f68c748bec8fd88085a3c4dff0d270d /Emby.Server.Implementations/Library/UserManager.cs | |
| parent | b0608d26b492b07f22ed745a7077975da733a780 (diff) | |
| parent | ffe79c89829fb232e8ccb4ae4caf4b732ce51600 (diff) | |
Merge pull request #740 from Bond-009/deadcode
Remove code for pre-installed plugins & properly check if file exists
Diffstat (limited to 'Emby.Server.Implementations/Library/UserManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Library/UserManager.cs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Emby.Server.Implementations/Library/UserManager.cs b/Emby.Server.Implementations/Library/UserManager.cs index 6139659b7..d6f844650 100644 --- a/Emby.Server.Implementations/Library/UserManager.cs +++ b/Emby.Server.Implementations/Library/UserManager.cs @@ -1029,6 +1029,11 @@ namespace Emby.Server.Implementations.Library { var path = GetPolicyFilePath(user); + if (!File.Exists(path)) + { + return GetDefaultPolicy(user); + } + try { lock (_policySyncLock) @@ -1036,10 +1041,6 @@ namespace Emby.Server.Implementations.Library return (UserPolicy)_xmlSerializer.DeserializeFromFile(typeof(UserPolicy), path); } } - catch (FileNotFoundException) - { - return GetDefaultPolicy(user); - } catch (IOException) { return GetDefaultPolicy(user); @@ -1128,6 +1129,11 @@ namespace Emby.Server.Implementations.Library { var path = GetConfigurationFilePath(user); + if (!File.Exists(path)) + { + return new UserConfiguration(); + } + try { lock (_configSyncLock) @@ -1135,10 +1141,6 @@ namespace Emby.Server.Implementations.Library return (UserConfiguration)_xmlSerializer.DeserializeFromFile(typeof(UserConfiguration), path); } } - catch (FileNotFoundException) - { - return new UserConfiguration(); - } catch (IOException) { return new UserConfiguration(); |
