aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations')
-rw-r--r--Emby.Server.Implementations/AppBase/ConfigurationHelper.cs5
-rw-r--r--Emby.Server.Implementations/Cryptography/CryptographyProvider.cs3
-rw-r--r--Emby.Server.Implementations/Session/WebSocketController.cs3
3 files changed, 7 insertions, 4 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);
diff --git a/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs b/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs
index a48b6f356..8d7f73b3c 100644
--- a/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs
+++ b/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs
@@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
+using MediaBrowser.Common.Extensions;
using MediaBrowser.Model.Cryptography;
using static MediaBrowser.Common.Cryptography.Constants;
@@ -83,7 +84,7 @@ namespace Emby.Server.Implementations.Cryptography
using var h = HashAlgorithm.Create(hashMethod);
if (h == null)
{
- throw new NullReferenceException(nameof(h));
+ throw new ResourceNotFoundException(nameof(h));
}
if (salt.Length == 0)
diff --git a/Emby.Server.Implementations/Session/WebSocketController.cs b/Emby.Server.Implementations/Session/WebSocketController.cs
index 7559ccb78..78f83e337 100644
--- a/Emby.Server.Implementations/Session/WebSocketController.cs
+++ b/Emby.Server.Implementations/Session/WebSocketController.cs
@@ -8,6 +8,7 @@ using System.Linq;
using System.Net.WebSockets;
using System.Threading;
using System.Threading.Tasks;
+using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Session;
using MediaBrowser.Model.Net;
@@ -59,7 +60,7 @@ namespace Emby.Server.Implementations.Session
{
if (sender == null)
{
- throw new NullReferenceException(nameof(sender));
+ throw new ResourceNotFoundException(nameof(sender));
}
var connection = (IWebSocketConnection)sender;