diff --git a/Source/Core/Controls/ResourceListEditor.cs b/Source/Core/Controls/ResourceListEditor.cs
index 0a05f8faed1c99ce3a01251d99601c1ce668a9a4..3548df439eaf406d60ead7d83cada0061abca717 100755
--- a/Source/Core/Controls/ResourceListEditor.cs
+++ b/Source/Core/Controls/ResourceListEditor.cs
@@ -205,7 +205,9 @@ namespace CodeImp.DoomBuilder.Controls
 
 			cancellation.Dispose();
 
-			if (loadingrequiredarchives[location] == cancellation)
+			// Loading might have been canceled outside of here, so make sure that the location is still in the list.
+			// See https://github.com/jewalky/UltimateDoomBuilder/issues/813
+			if (loadingrequiredarchives.ContainsKey(location) && loadingrequiredarchives[location] == cancellation)
 			{
 				General.WriteLogLine(string.Format("Resource check completed for: {0} (Match = {1}, RequiredArchives = {2})", location, loadingrequiredarchives[location] == cancellation, string.Join(",", loc.requiredarchives)));
 				loadingrequiredarchives.Remove(location);