aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2020-08-26 18:59:46 +0200
committerGitHub <noreply@github.com>2020-08-26 18:59:46 +0200
commit4f6c98b325aa544ac1f3a522ea668b3f990265e3 (patch)
tree40c38d1a8d4214722b2fed816616cc0a22de7577 /Emby.Server.Implementations
parent4e3f26b647a9fe996b5a96ea10fa1f2468ea41fb (diff)
parentde4cfa223498dde4e665c452337f032c29270abe (diff)
Merge pull request #3984 from crobibero/json-prerelease
Use Prerelease System.Text.Json
Diffstat (limited to 'Emby.Server.Implementations')
-rw-r--r--Emby.Server.Implementations/Data/SqliteItemRepository.cs3
-rw-r--r--Emby.Server.Implementations/HttpServer/WebSocketConnection.cs8
2 files changed, 7 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
index 48e2f5d4a..5bf740cfc 100644
--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
@@ -90,9 +90,6 @@ namespace Emby.Server.Implementations.Data
_typeMapper = new TypeMapper();
_jsonOptions = JsonDefaults.GetOptions();
- // GetItem throws NotSupportedException with this enabled, so hardcode false.
- _jsonOptions.IgnoreNullValues = false;
-
DbFilePath = Path.Combine(_config.ApplicationPaths.DataPath, "library.db");
}
diff --git a/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs b/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs
index d738047e0..7eae4e764 100644
--- a/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs
+++ b/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs
@@ -179,7 +179,7 @@ namespace Emby.Server.Implementations.HttpServer
return;
}
- WebSocketMessage<object> stub;
+ WebSocketMessage<object>? stub;
try
{
@@ -209,6 +209,12 @@ namespace Emby.Server.Implementations.HttpServer
return;
}
+ if (stub == null)
+ {
+ _logger.LogError("Error processing web socket message");
+ return;
+ }
+
// Tell the PipeReader how much of the buffer we have consumed
reader.AdvanceTo(buffer.End);