Reviewed by me, fix by Kida-san.
[WebKit-https.git] / WebCore / kwq / WebCoreBridge.mm
index e3660865c78ab1fc950b86e793d93de692d3b935..4111cc2da66668cc354a1eb5a9c74410af9f2a9b 100644 (file)
@@ -1628,6 +1628,10 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
 
 - (NSRange)convertToNSRange:(DOM::RangeImpl *)drange
 {
+    if (!drange) {
+        return NSMakeRange(NSNotFound, 0);
+    }
+
     Range toStartRange, toEndRange;
     Range actualRange = Range(drange);
     long startPosition, endPosition;