Gracefully handle missing auto pause key on remote inspector setup
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Apr 2015 23:46:18 +0000 (23:46 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Apr 2015 23:46:18 +0000 (23:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=144411

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-04-29
Reviewed by Timothy Hatcher.

* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::receivedSetupMessage):

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/remote/RemoteInspector.mm

index 17f2080..09d1143 100644 (file)
@@ -1,5 +1,15 @@
 2015-04-29  Joseph Pecoraro  <pecoraro@apple.com>
 
+        Gracefully handle missing auto pause key on remote inspector setup
+        https://bugs.webkit.org/show_bug.cgi?id=144411
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/remote/RemoteInspector.mm:
+        (Inspector::RemoteInspector::receivedSetupMessage):
+
+2015-04-29  Joseph Pecoraro  <pecoraro@apple.com>
+
         NodeList has issues with Symbol and empty string
         https://bugs.webkit.org/show_bug.cgi?id=144310
 
index 8d00a08..6814dd3 100644 (file)
@@ -572,7 +572,12 @@ void RemoteInspector::receivedSetupMessage(NSDictionary *userInfo)
     RemoteInspectorDebuggableInfo debuggableInfo = it->value.second;
     RefPtr<RemoteInspectorDebuggableConnection> connection = adoptRef(new RemoteInspectorDebuggableConnection(debuggable, connectionIdentifier, sender, debuggableInfo.type));
     bool isAutomaticInspection = m_automaticInspectionCandidateIdentifier == debuggable->identifier();
-    bool automaticallyPause = [[userInfo objectForKey:WIRAutomaticallyPause] boolValue];
+
+    bool automaticallyPause = false;
+    NSNumber *automaticallyPauseObject = [userInfo objectForKey:WIRAutomaticallyPause];
+    if ([automaticallyPauseObject isKindOfClass:[NSNumber class]])
+        automaticallyPause = [automaticallyPauseObject boolValue];
+
     if (!connection->setup(isAutomaticInspection, automaticallyPause)) {
         connection->close();
         return;