From d04e255a7993e4af09b5849dc319922950007269 Mon Sep 17 00:00:00 2001 From: Bond-009 Date: Thu, 23 Jul 2020 10:34:32 +0200 Subject: [PATCH] Merge pull request #3552 from BaronGreenback/NotificationFix Fixes #3551 (Notifications Serialization error) (cherry picked from commit 944fdb4c621fa2b65e970554d4e4daf7841a7a93) Signed-off-by: Joshua M. Boniface --- .../Notifications/NotificationOption.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/MediaBrowser.Model/Notifications/NotificationOption.cs b/MediaBrowser.Model/Notifications/NotificationOption.cs index ea363d9b17..58aecb3d35 100644 --- a/MediaBrowser.Model/Notifications/NotificationOption.cs +++ b/MediaBrowser.Model/Notifications/NotificationOption.cs @@ -1,3 +1,4 @@ +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; @@ -9,21 +10,27 @@ namespace MediaBrowser.Model.Notifications public NotificationOption(string type) { Type = type; + DisabledServices = Array.Empty(); + DisabledMonitorUsers = Array.Empty(); + SendToUsers = Array.Empty(); + } + public NotificationOption() + { DisabledServices = Array.Empty(); DisabledMonitorUsers = Array.Empty(); SendToUsers = Array.Empty(); } - public string Type { get; set; } + public string? Type { get; set; } /// - /// User Ids to not monitor (it's opt out). + /// Gets or sets user Ids to not monitor (it's opt out). /// public string[] DisabledMonitorUsers { get; set; } /// - /// User Ids to send to (if SendToUserMode == Custom) + /// Gets or sets user Ids to send to (if SendToUserMode == Custom). /// public string[] SendToUsers { get; set; }