check for null array in HashMapIterator::find

This commit is contained in:
Joel Dice 2008-12-18 20:23:08 -07:00
parent 21df2e9153
commit bd89b8e00a

View File

@ -107,11 +107,13 @@ class HashMapIterator: public Thread::Protector {
void find() {
object array = hashMapArray(t, map);
for (unsigned i = index; i < arrayLength(t, array); ++i) {
if (arrayBody(t, array, i)) {
node = arrayBody(t, array, i);
index = i + 1;
return;
if (array) {
for (unsigned i = index; i < arrayLength(t, array); ++i) {
if (arrayBody(t, array, i)) {
node = arrayBody(t, array, i);
index = i + 1;
return;
}
}
}
node = 0;