aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Session/SessionManager.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2022-12-07 17:17:37 +0100
committerGitHub <noreply@github.com>2022-12-07 17:17:37 +0100
commit584c80e323ac2a1386d86ff9f59e50daf174418e (patch)
tree4dbb2861cb79cf418a76a4b8f364fdc5c62b56f7 /Emby.Server.Implementations/Session/SessionManager.cs
parentf3c57e6a0ae015dc51cf548a0380d1bed33959c2 (diff)
parent227aa0540bf0d6c00848b0efb8a5e0ece86c7412 (diff)
Merge pull request #8547 from Bond-009/net7
Diffstat (limited to 'Emby.Server.Implementations/Session/SessionManager.cs')
-rw-r--r--Emby.Server.Implementations/Session/SessionManager.cs32
1 files changed, 6 insertions, 26 deletions
diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs
index 2add9be80..2f60d01a9 100644
--- a/Emby.Server.Implementations/Session/SessionManager.cs
+++ b/Emby.Server.Implementations/Session/SessionManager.cs
@@ -264,20 +264,9 @@ namespace Emby.Server.Implementations.Session
{
CheckDisposed();
- if (string.IsNullOrEmpty(appName))
- {
- throw new ArgumentNullException(nameof(appName));
- }
-
- if (string.IsNullOrEmpty(appVersion))
- {
- throw new ArgumentNullException(nameof(appVersion));
- }
-
- if (string.IsNullOrEmpty(deviceId))
- {
- throw new ArgumentNullException(nameof(deviceId));
- }
+ ArgumentException.ThrowIfNullOrEmpty(appName);
+ ArgumentException.ThrowIfNullOrEmpty(appVersion);
+ ArgumentException.ThrowIfNullOrEmpty(deviceId);
var activityDate = DateTime.UtcNow;
var session = await GetSessionInfo(appName, appVersion, deviceId, deviceName, remoteEndPoint, user).ConfigureAwait(false);
@@ -478,10 +467,7 @@ namespace Emby.Server.Implementations.Session
{
CheckDisposed();
- if (string.IsNullOrEmpty(deviceId))
- {
- throw new ArgumentNullException(nameof(deviceId));
- }
+ ArgumentException.ThrowIfNullOrEmpty(deviceId);
var key = GetSessionKey(appName, deviceId);
@@ -1571,10 +1557,7 @@ namespace Emby.Server.Implementations.Session
{
CheckDisposed();
- if (string.IsNullOrEmpty(accessToken))
- {
- throw new ArgumentNullException(nameof(accessToken));
- }
+ ArgumentException.ThrowIfNullOrEmpty(accessToken);
var existing = (await _deviceManager.GetDevices(
new DeviceQuery
@@ -1744,10 +1727,7 @@ namespace Emby.Server.Implementations.Session
/// <inheritdoc />
public void ReportNowViewingItem(string sessionId, string itemId)
{
- if (string.IsNullOrEmpty(itemId))
- {
- throw new ArgumentNullException(nameof(itemId));
- }
+ ArgumentException.ThrowIfNullOrEmpty(itemId);
var item = _libraryManager.GetItemById(new Guid(itemId));
var session = GetSession(sessionId);