Merge pull request #14003 from karroffel/dictionary-iterate-fix

fix Dictionary iteration
This commit is contained in:
Rémi Verschelde 2017-12-07 00:22:38 +01:00 committed by GitHub
commit a88543c881
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -204,7 +204,9 @@ const Variant *Dictionary::next(const Variant *p_key) const {
if (p_key == NULL) { if (p_key == NULL) {
// caller wants to get the first element // 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); OrderedHashMap<Variant, Variant, _DictionaryVariantHash>::Element E = _p->variant_map.find(*p_key);