소스 검색

Fix crash when iterating through empty dictionary.

Lyuma 4 년 전
부모
커밋
0d4b750051
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      modules/gdscript/gdscript_vm.cpp

+ 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.