From 5d63181cac6eb2c0ce137190ab2383a1798c66af Mon Sep 17 00:00:00 2001 From: Ske Date: Wed, 30 Oct 2019 09:09:09 +0100 Subject: [PATCH] Fix exporting --- PluralKit.Core/Models.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PluralKit.Core/Models.cs b/PluralKit.Core/Models.cs index 8269380d..61d769b0 100644 --- a/PluralKit.Core/Models.cs +++ b/PluralKit.Core/Models.cs @@ -14,8 +14,8 @@ namespace PluralKit public ProxyTag(string prefix, string suffix) { // Normalize empty strings to null for DB - Prefix = prefix.Length == 0 ? null : prefix; - Suffix = suffix.Length == 0 ? null : suffix; + Prefix = prefix?.Length == 0 ? null : prefix; + Suffix = suffix?.Length == 0 ? null : suffix; } [JsonProperty("prefix")] public string Prefix { get; set; } @@ -72,13 +72,13 @@ namespace PluralKit // Don't use, unless you're the API's serialization library [JsonProperty("prefix")] [Obsolete("Use PKMember.ProxyTags")] public string Prefix { - get => ProxyTags.FirstOrDefault().Prefix; + get => ProxyTags?.FirstOrDefault().Prefix; set => ProxyTags = new[] {new ProxyTag(Prefix, value)}; } [JsonProperty("suffix")] [Obsolete("Use PKMember.ProxyTags")] public string Suffix { - get => ProxyTags.FirstOrDefault().Prefix; + get => ProxyTags?.FirstOrDefault().Prefix; set => ProxyTags = new[] {new ProxyTag(Prefix, value)}; }