From 2ba4edbfb702f526c6f0109c683b0141d87c6423 Mon Sep 17 00:00:00 2001 From: karroffel Date: Tue, 5 Dec 2017 20:00:44 +0100 Subject: [PATCH] fix Dictionary iteration --- core/dictionary.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/dictionary.cpp b/core/dictionary.cpp index 48e65c734fb..44fce2474ff 100644 --- a/core/dictionary.cpp +++ b/core/dictionary.cpp @@ -204,7 +204,9 @@ const Variant *Dictionary::next(const Variant *p_key) const { if (p_key == NULL) { // caller wants to get the first element - return &_p->variant_map.front().key(); + if (_p->variant_map.front()) + return &_p->variant_map.front().key(); + return NULL; } OrderedHashMap::Element E = _p->variant_map.find(*p_key);