2
0
Эх сурвалжийг харах

Fix crash when iterating through empty dictionary.

Lyuma 4 жил өмнө
parent
commit
0d4b750051

+ 1 - 1
modules/gdscript/gdscript_vm.cpp

@@ -2306,10 +2306,10 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
 
 				Dictionary *dict = VariantInternal::get_dictionary(container);
 				const Variant *next = dict->next(nullptr);
-				*counter = *next;
 
 				if (!dict->empty()) {
 					GET_INSTRUCTION_ARG(iterator, 2);
+					*counter = *next;
 					*iterator = *next;
 
 					// Skip regular iterate.