From a9fcbc686d203b20f8e4b127e213b7028b3a9ae1 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 8 Sep 2021 19:01:40 -0400 Subject: fix error when loading corrupted translation files --- src/SMAPI/Framework/SCore.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/SMAPI/Framework') diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index 5913430e..df6cd129 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -1891,9 +1891,9 @@ namespace StardewModdingAPI.Framework string locale = Path.GetFileNameWithoutExtension(file.Name.ToLower().Trim()); try { - if (!jsonHelper.ReadJsonFileIfExists(file.FullName, out IDictionary data)) + if (!jsonHelper.ReadJsonFileIfExists(file.FullName, out IDictionary data) || data == null) { - errors.Add($"{file.Name} file couldn't be read"); // should never happen, since we're iterating files that exist + errors.Add($"{file.Name} file couldn't be read"); // mainly happens when the file is corrupted or empty continue; } -- cgit