aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-11-13 11:14:44 -0700
committercrobibero <cody@robibe.ro>2020-11-13 11:14:44 -0700
commit5f52a58e785fa4ae06fa07a93b81c1e7547ac9f3 (patch)
tree68466ae2c11051e631a4cf06a43cf14da1f4d756 /Emby.Server.Implementations/AppBase/ConfigurationHelper.cs
parentbe312f992d92433e3e7619e264889d1a0afadf26 (diff)
Convert NullReferenceException to ResourceNotFoundException
Diffstat (limited to 'Emby.Server.Implementations/AppBase/ConfigurationHelper.cs')
-rw-r--r--Emby.Server.Implementations/AppBase/ConfigurationHelper.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs b/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs
index e19ce5edf..8cca5cc77 100644
--- a/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs
+++ b/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs
@@ -3,6 +3,7 @@
using System;
using System.IO;
using System.Linq;
+using MediaBrowser.Common.Extensions;
using MediaBrowser.Model.Serialization;
namespace Emby.Server.Implementations.AppBase
@@ -36,7 +37,7 @@ namespace Emby.Server.Implementations.AppBase
catch (Exception)
{
var instanceConfiguration = Activator.CreateInstance(type);
- configuration = instanceConfiguration ?? throw new NullReferenceException(nameof(instanceConfiguration));
+ configuration = instanceConfiguration ?? throw new ResourceNotFoundException(nameof(instanceConfiguration));
}
using var stream = new MemoryStream(buffer?.Length ?? 0);
@@ -52,7 +53,7 @@ namespace Emby.Server.Implementations.AppBase
var directory = Path.GetDirectoryName(path);
if (directory == null)
{
- throw new NullReferenceException(nameof(directory));
+ throw new ResourceNotFoundException(nameof(directory));
}
Directory.CreateDirectory(directory);