From a7d2a2c3d5af7137804416ba4e5fbdd27bd10f1e Mon Sep 17 00:00:00 2001 From: pizzaboxer Date: Tue, 9 Jul 2024 21:57:37 +0400 Subject: [PATCH] Fix JSON import not working in the flag editor oooops --- .../UI/Elements/Menu/Pages/FastFlagEditorPage.xaml.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorPage.xaml.cs b/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorPage.xaml.cs index 022b637b..d7d5cf0b 100644 --- a/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorPage.xaml.cs +++ b/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorPage.xaml.cs @@ -234,13 +234,12 @@ private void ImportJSON(string json) if (App.FastFlags.Prop.ContainsKey(pair.Key) && !overwriteConflicting) continue; - // TODO - error message, i just had to hastily add this in - // as i'm currently testing 2.7.0 for release and all translations - // are already done - if (pair.Value is not string) + var val = pair.Value.ToString(); + + if (val is null) continue; - if (!ValidateFlagEntry(pair.Key, (string)pair.Value)) + if (!ValidateFlagEntry(pair.Key, val)) continue; App.FastFlags.SetValue(pair.Key, pair.Value);