summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkarroffel <therzog@mail.de>2017-12-05 20:00:44 +0100
committerkarroffel <therzog@mail.de>2017-12-05 20:00:44 +0100
commit2ba4edbfb702f526c6f0109c683b0141d87c6423 (patch)
tree48165f0ca543f0612e8c2694dbbab327abf407be
parent1587f45c2551a43db2808f2c5938095e19f060d2 (diff)
downloadredot-engine-2ba4edbfb702f526c6f0109c683b0141d87c6423.tar.gz
fix Dictionary iteration
-rw-r--r--core/dictionary.cpp4
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);