Merge pull request #44604 from lyuma/gdscript_dictionary_crash

GDScript: Fix crash when iterating through empty dictionary.
This commit is contained in:
Rémi Verschelde 2021-01-11 13:53:12 +01:00 committed by GitHub
commit 3e9a40cdc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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->is_empty()) {
GET_INSTRUCTION_ARG(iterator, 2);
*counter = *next;
*iterator = *next;
// Skip regular iterate.