diff options
author | Kristian Monsen <kristianm@google.com> | 2011-02-01 14:35:38 +0000 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2011-02-01 14:43:24 +0000 |
commit | 6bec8b1c3fd6c34edbfb13eaecdc8735bb0f616a (patch) | |
tree | 553ecdfb3e4c6741b952cea2aaed7d7adda8ebf7 /WebKit/android/jni/WebViewCore.cpp | |
parent | 29c8524f8c57fe35a3d70e3e4a8235dae9364bb1 (diff) | |
download | external_webkit-6bec8b1c3fd6c34edbfb13eaecdc8735bb0f616a.zip external_webkit-6bec8b1c3fd6c34edbfb13eaecdc8735bb0f616a.tar.gz external_webkit-6bec8b1c3fd6c34edbfb13eaecdc8735bb0f616a.tar.bz2 |
Fix CTS test crash
Change-Id: If7027193d456ec986e9a9d61edc958d97cc1b653
Diffstat (limited to 'WebKit/android/jni/WebViewCore.cpp')
-rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index 3328acd..8361c17 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -1179,10 +1179,12 @@ void WebViewCore::setScrollOffset(int moveGeneration, int userScrolled, int dx, // scrolling can generate lots of small scroll offset, the following code // reduces the saving frequency. static const int MIN_SCROLL_DIFF = 32; - WebCore::IntPoint currentPoint = history->currentItem()->scrollPoint(); - if (std::abs(currentPoint.x() - dx) >= MIN_SCROLL_DIFF || - std::abs(currentPoint.y() - dy) >= MIN_SCROLL_DIFF) { - history->saveScrollPositionAndViewStateToItem(history->currentItem()); + if (history->currentItem()) { + WebCore::IntPoint currentPoint = history->currentItem()->scrollPoint(); + if (std::abs(currentPoint.x() - dx) >= MIN_SCROLL_DIFF || + std::abs(currentPoint.y() - dy) >= MIN_SCROLL_DIFF) { + history->saveScrollPositionAndViewStateToItem(history->currentItem()); + } } // update the currently visible screen |