diff options
Diffstat (limited to 'src/qml/jsruntime/qv4objectiterator.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4objectiterator.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4objectiterator.cpp b/src/qml/jsruntime/qv4objectiterator.cpp index 89880d86dd..3d193455e9 100644 --- a/src/qml/jsruntime/qv4objectiterator.cpp +++ b/src/qml/jsruntime/qv4objectiterator.cpp @@ -54,7 +54,7 @@ void ForInIteratorPrototype::init(ExecutionEngine *) PropertyKey ObjectIterator::next(Property *pd, PropertyAttributes *attrs) { - if (!object) + if (!object || !iterator) return PropertyKey::invalid(); Scope scope(engine); @@ -196,6 +196,10 @@ PropertyKey ForInIteratorObject::nextProperty() const break; delete d()->iterator; d()->iterator = c->ownPropertyKeys(); + if (!d()->iterator) { + scope.engine->throwTypeError(); + return PropertyKey::invalid(); + } } return PropertyKey::invalid(); } |