Fix invalid optional access in WebDriver Session::createTopLevelBrowsingContext.
authorMs2ger@igalia.com <Ms2ger@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Aug 2018 18:36:31 +0000 (18:36 +0000)
committerMs2ger@igalia.com <Ms2ger@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Aug 2018 18:36:31 +0000 (18:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=188304

Reviewed by Brian Burg.

* Session.cpp:
(WebDriver::Session::createTopLevelBrowsingContext): remove incorrect value() call.

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

Source/WebDriver/ChangeLog
Source/WebDriver/Session.cpp

index 1caf574..473252d 100644 (file)
@@ -1,3 +1,13 @@
+2018-08-03  Ms2ger  <Ms2ger@igalia.com>
+
+        Fix invalid optional access in WebDriver Session::createTopLevelBrowsingContext.
+        https://bugs.webkit.org/show_bug.cgi?id=188304
+
+        Reviewed by Brian Burg.
+
+        * Session.cpp:
+        (WebDriver::Session::createTopLevelBrowsingContext): remove incorrect value() call.
+
 2018-07-26  Ross Kirsling  <ross.kirsling@sony.com>
 
         String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter
index 779be1f..bfc7380 100644 (file)
@@ -177,7 +177,7 @@ std::optional<String> Session::pageLoadStrategyString() const
 
 void Session::createTopLevelBrowsingContext(Function<void (CommandResult&&)>&& completionHandler)
 {
-    ASSERT(!m_toplevelBrowsingContext.value());
+    ASSERT(!m_toplevelBrowsingContext);
     m_host->sendCommandToBackend("createBrowsingContext"_s, nullptr, [this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)](SessionHost::CommandResponse&& response) mutable {
         if (response.isError || !response.responseObject) {
             completionHandler(CommandResult::fail(WTFMove(response.responseObject)));