Add form delegate method that's invoked right before sending a submit event to a...
[WebKit-https.git] / Tools / TestWebKitAPI / mac / PlatformUtilitiesMac.mm
index afa28a7..979f4cd 100644 (file)
@@ -78,6 +78,9 @@ bool isKeyDown(WKNativeEventPtr event)
 
 std::string toSTD(NSString *string)
 {
+    if (!string)
+        return std::string();
+
     size_t bufferSize = [string lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
     OwnArrayPtr<char> buffer = adoptArrayPtr(new char[bufferSize]);
     NSUInteger stringLength;