From bd89b8e00a7beb5c7ef0784a50019de104ab364f Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Thu, 18 Dec 2008 20:23:08 -0700 Subject: [PATCH] check for null array in HashMapIterator::find --- src/util.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/util.h b/src/util.h index 9dcdd5730e..bf895f6bae 100644 --- a/src/util.h +++ b/src/util.h @@ -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;