From a1d91784a0c25f996974d37dec6c02df6ede821d Mon Sep 17 00:00:00 2001 From: Ske Date: Sat, 7 Mar 2020 17:30:22 +0100 Subject: [PATCH] Fix importing older export files --- PluralKit.Core/Services/DataFileService.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PluralKit.Core/Services/DataFileService.cs b/PluralKit.Core/Services/DataFileService.cs index b8e77724..03e2eace 100644 --- a/PluralKit.Core/Services/DataFileService.cs +++ b/PluralKit.Core/Services/DataFileService.cs @@ -271,11 +271,13 @@ namespace PluralKit.Core !Pronouns.IsLongerThan(Limits.MaxPronounsLength) && (Color == null || Regex.IsMatch(Color, "[0-9a-fA-F]{6}")) && (Birthday == null || DateTimeFormats.DateExportFormat.Parse(Birthday).Success) && - + // Sanity checks !AvatarUrl.IsLongerThan(1000) && - ProxyTags.Count < 100 && - ProxyTags.All(t => !t.ProxyString.IsLongerThan(100)) && + + // Older versions have Prefix and Suffix as fields, meaning ProxyTags is null + (ProxyTags == null || ProxyTags.Count < 100 && + ProxyTags.All(t => !t.ProxyString.IsLongerThan(100))) && !Prefix.IsLongerThan(100) && !Suffix.IsLongerThan(100); }