diff options
-rw-r--r-- | core/dictionary.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/dictionary.cpp b/core/dictionary.cpp index 48e65c734f..44fce2474f 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<Variant, Variant, _DictionaryVariantHash>::Element E = _p->variant_map.find(*p_key); |