You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-23 15:16:17 +00:00
Merge pull request #44604 from lyuma/gdscript_dictionary_crash
GDScript: Fix crash when iterating through empty dictionary.
This commit is contained in:
@@ -2306,10 +2306,10 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
|
|||||||
|
|
||||||
Dictionary *dict = VariantInternal::get_dictionary(container);
|
Dictionary *dict = VariantInternal::get_dictionary(container);
|
||||||
const Variant *next = dict->next(nullptr);
|
const Variant *next = dict->next(nullptr);
|
||||||
*counter = *next;
|
|
||||||
|
|
||||||
if (!dict->is_empty()) {
|
if (!dict->is_empty()) {
|
||||||
GET_INSTRUCTION_ARG(iterator, 2);
|
GET_INSTRUCTION_ARG(iterator, 2);
|
||||||
|
*counter = *next;
|
||||||
*iterator = *next;
|
*iterator = *next;
|
||||||
|
|
||||||
// Skip regular iterate.
|
// Skip regular iterate.
|
||||||
|
|||||||
Reference in New Issue
Block a user