From e6489eaca32a7e6897c50899bb61d40223566cb7 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sun, 24 Jan 2021 20:51:58 -0500 Subject: [PATCH] Fixed: Blank Page after Delete for Index/Editor (Avoid null broadcasts) --- frontend/src/Components/SignalRConnector.js | 5 +++++ src/Lidarr.Http/LidarrRestModuleWithSignalR.cs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/Components/SignalRConnector.js b/frontend/src/Components/SignalRConnector.js index 81f10ab28..028aafce1 100644 --- a/frontend/src/Components/SignalRConnector.js +++ b/frontend/src/Components/SignalRConnector.js @@ -138,6 +138,11 @@ class SignalRConnector extends Component { const handler = this[getHandlerName(name)]; + if (body && body.action === 'updated' && !body.resource) { + console.error(`signalR: Null resource broadcast ignored for ${name}`); + return; + } + if (handler) { handler(body); return; diff --git a/src/Lidarr.Http/LidarrRestModuleWithSignalR.cs b/src/Lidarr.Http/LidarrRestModuleWithSignalR.cs index 0074da5cd..abd024c1c 100644 --- a/src/Lidarr.Http/LidarrRestModuleWithSignalR.cs +++ b/src/Lidarr.Http/LidarrRestModuleWithSignalR.cs @@ -58,7 +58,7 @@ namespace Lidarr.Http protected void BroadcastResourceChange(ModelAction action, TResource resource) { - if (!_signalRBroadcaster.IsConnected) + if (!_signalRBroadcaster.IsConnected || resource == null) { return; }