Crashes under detectItemAroundHitTestResult when DataDetectors is not available
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Feb 2015 03:59:28 +0000 (03:59 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Feb 2015 03:59:28 +0000 (03:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=141549
<rdar://problem/19180955>

Reviewed by Dan Bernstein.

* editing/mac/DataDetection.mm:
(WebCore::DataDetection::detectItemAroundHitTestResult):
Bail out from data detection if either of the relevant frameworks aren't loaded.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180028 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/editing/mac/DataDetection.mm

index 60f6a63..ea75d55 100644 (file)
@@ -1,3 +1,15 @@
+2015-02-12  Timothy Horton  <timothy_horton@apple.com>
+
+        Crashes under detectItemAroundHitTestResult when DataDetectors is not available
+        https://bugs.webkit.org/show_bug.cgi?id=141549
+        <rdar://problem/19180955>
+
+        Reviewed by Dan Bernstein.
+
+        * editing/mac/DataDetection.mm:
+        (WebCore::DataDetection::detectItemAroundHitTestResult):
+        Bail out from data detection if either of the relevant frameworks aren't loaded.
+
 2015-02-12  Dean Jackson  <dino@apple.com>
 
         [iOS Media] Audio should hide timeline scrubber until playback starts
index 42b7bad..8bc51ca 100644 (file)
@@ -43,6 +43,9 @@ namespace WebCore {
 
 RetainPtr<DDActionContext> DataDetection::detectItemAroundHitTestResult(const HitTestResult& hitTestResult, FloatRect& detectedDataBoundingBox, RefPtr<Range>& detectedDataRange)
 {
+    if (!DataDetectorsLibrary() || !DataDetectorsCoreLibrary())
+        return nullptr;
+
     Node* node = hitTestResult.innerNonSharedNode();
     if (!node)
         return nullptr;