Safari build crashes when "zooming into"/choosing a tab from tab view
authorconrad_shultz@apple.com <conrad_shultz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 27 Dec 2014 05:46:33 +0000 (05:46 +0000)
committerconrad_shultz@apple.com <conrad_shultz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 27 Dec 2014 05:46:33 +0000 (05:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=139934

Reviewed by Dan Bernstein.

* UIProcess/API/mac/WKView.mm:
(-[WKView _setIgnoresNonWheelEvents:]):
Trying to add a nil gesture recognizer raises an exception. Stop assuming that a
gesture recognizer is non-nil.

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/mac/WKView.mm

index dc3b32e..1413f82 100644 (file)
@@ -1,3 +1,15 @@
+2014-12-26  Conrad Shultz  <conrad_shultz@apple.com>
+
+        Safari build crashes when "zooming into"/choosing a tab from tab view
+        https://bugs.webkit.org/show_bug.cgi?id=139934
+
+        Reviewed by Dan Bernstein.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView _setIgnoresNonWheelEvents:]):
+        Trying to add a nil gesture recognizer raises an exception. Stop assuming that a
+        gesture recognizer is non-nil.
+
 2014-12-26  Anders Carlsson  <andersca@apple.com>
 
         Handle more types in the UserData encode/decode functions
index 6be87bf..9d1e9c1 100644 (file)
@@ -4104,8 +4104,8 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path)
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
     if (ignoresNonWheelEvents)
         [self removeGestureRecognizer:_data->_immediateActionGestureRecognizer.get()];
-    else
-        [self addGestureRecognizer:_data->_immediateActionGestureRecognizer.get()];
+    else if (NSGestureRecognizer *immediateActionRecognizer = _data->_immediateActionGestureRecognizer.get())
+        [self addGestureRecognizer:immediateActionRecognizer];
 #endif
 }