From 0d4b750051ac8e31349cb71c31f98a93acf317bb Mon Sep 17 00:00:00 2001 From: Lyuma Date: Mon, 21 Dec 2020 20:13:05 -0800 Subject: Fix crash when iterating through empty dictionary. --- modules/gdscript/gdscript_vm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gdscript/gdscript_vm.cpp b/modules/gdscript/gdscript_vm.cpp index b8e1791467..4f50ed8271 100644 --- a/modules/gdscript/gdscript_vm.cpp +++ b/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. -- cgit v1.2.3