summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WebKit/android/jni/WebCoreFrameBridge.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/WebKit/android/jni/WebCoreFrameBridge.cpp b/WebKit/android/jni/WebCoreFrameBridge.cpp
index 10c8439..868233a 100644
--- a/WebKit/android/jni/WebCoreFrameBridge.cpp
+++ b/WebKit/android/jni/WebCoreFrameBridge.cpp
@@ -532,7 +532,12 @@ WebFrame::loadStarted(WebCore::Frame* frame)
#ifdef ANDROID_INSTRUMENT
TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
#endif
- const WebCore::KURL& url = frame->loader()->activeDocumentLoader()->url();
+ // activeDocumentLoader() can return null.
+ DocumentLoader* documentLoader = frame->loader()->activeDocumentLoader();
+ if (documentLoader == NULL)
+ return;
+
+ const WebCore::KURL& url = documentLoader->url();
if (url.isEmpty())
return;
LOGV("::WebCore:: loadStarted %s", url.string().ascii().data());
@@ -598,8 +603,14 @@ WebFrame::didFinishLoad(WebCore::Frame* frame)
TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
#endif
JNIEnv* env = getJNIEnv();
+
+ // activeDocumentLoader() can return null.
WebCore::FrameLoader* loader = frame->loader();
- const WebCore::KURL& url = loader->activeDocumentLoader()->url();
+ DocumentLoader* documentLoader = loader->activeDocumentLoader();
+ if (documentLoader == NULL)
+ return;
+
+ const WebCore::KURL& url = documentLoader->url();
if (url.isEmpty())
return;
LOGV("::WebCore:: didFinishLoad %s", url.string().ascii().data());