summaryrefslogtreecommitdiffstats
path: root/WebKit/android/jni/WebHistory.cpp
diff options
context:
space:
mode:
authorPatrick Scott <phanna@android.com>2009-12-01 09:07:17 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-12-01 09:07:17 -0800
commit06c02c29d5f6b5c0a0b8e86fbfe9b2fac811c921 (patch)
treee12feeadb4b9d88b7ec7d4fe34d55ec2f4e91947 /WebKit/android/jni/WebHistory.cpp
parentdc168913e45ddd6c4024448b7f9ad0c0beb62e62 (diff)
parent6397e841625f1a0a7f3415752cf07903fb9e72ed (diff)
downloadexternal_webkit-06c02c29d5f6b5c0a0b8e86fbfe9b2fac811c921.zip
external_webkit-06c02c29d5f6b5c0a0b8e86fbfe9b2fac811c921.tar.gz
external_webkit-06c02c29d5f6b5c0a0b8e86fbfe9b2fac811c921.tar.bz2
am 6397e841: am db239ca3: Fix a crash when closing the native history.
Merge commit '6397e841625f1a0a7f3415752cf07903fb9e72ed' * commit '6397e841625f1a0a7f3415752cf07903fb9e72ed': Fix a crash when closing the native history.
Diffstat (limited to 'WebKit/android/jni/WebHistory.cpp')
-rw-r--r--WebKit/android/jni/WebHistory.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/WebKit/android/jni/WebHistory.cpp b/WebKit/android/jni/WebHistory.cpp
index 2fe5888..3eecaa9 100644
--- a/WebKit/android/jni/WebHistory.cpp
+++ b/WebKit/android/jni/WebHistory.cpp
@@ -122,9 +122,12 @@ static void WebHistoryClose(JNIEnv* env, jobject obj, jint frame)
// deleted parent.
WebCore::HistoryItem* item = parent->childItemWithTarget(child->tree()->name());
child->loader()->history()->setCurrentItem(item);
- // Append the first child to the queue if it exists.
- if (WebCore::Frame* f = child->tree()->firstChild())
- frameQueue.append(f);
+ // Append the first child to the queue if it exists. If there is no
+ // item, then we do not need to traverse the children since there
+ // will be no parent history item.
+ WebCore::Frame* firstChild;
+ if (item && (firstChild = child->tree()->firstChild()))
+ frameQueue.append(firstChild);
child = child->tree()->nextSibling();
// If we don't have a sibling for this frame and the queue isn't
// empty, use the next entry in the queue.