From d39b04334338ed245cace828c4ed756b3800ae24 Mon Sep 17 00:00:00 2001 From: Wojciech Figat Date: Mon, 15 Nov 2021 16:37:44 +0100 Subject: [PATCH] Fix for localization dashboard --- .../CustomEditors/Dedicated/LocalizationSettingsEditor.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Editor/CustomEditors/Dedicated/LocalizationSettingsEditor.cs b/Source/Editor/CustomEditors/Dedicated/LocalizationSettingsEditor.cs index a28f8f679..3f4903a6c 100644 --- a/Source/Editor/CustomEditors/Dedicated/LocalizationSettingsEditor.cs +++ b/Source/Editor/CustomEditors/Dedicated/LocalizationSettingsEditor.cs @@ -75,7 +75,7 @@ namespace FlaxEditor.CustomEditors.Dedicated _theMostTranslatedCulture = culture; _theMostTranslatedCultureCount = count; } - prop.Label(string.Format("Progress: {0}% ({1}/{2})", (int)(((float)validCount / allKeys.Count * 100.0f)), validCount, allKeys.Count)); + prop.Label(string.Format("Progress: {0}% ({1}/{2})", allKeys.Count > 0 ? (int)(((float)validCount / allKeys.Count * 100.0f)) : 0, validCount, allKeys.Count)); prop.Label("Tables:"); foreach (var table in e) { @@ -111,7 +111,7 @@ namespace FlaxEditor.CustomEditors.Dedicated } Profiler.BeginEvent("LocalizationSettingsEditor.AddLocale"); Editor.Log($"Adding culture '{displayName}' to localization settings"); - var newTables = settings.LocalizedStringTables.ToList(); + var newTables = settings.LocalizedStringTables?.ToList() ?? new List(); if (_theMostTranslatedCulture != null) { // Duplicate localization for culture with the highest amount of keys