summaryrefslogtreecommitdiff
path: root/Userland/Services/WebDriver/Session.h
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2023-03-07 09:16:01 -0500
committerLinus Groh <mail@linusgroh.de>2023-03-07 18:16:35 +0000
commit7be8931ca04c1bad04b1a0e6b46ab3b384a54970 (patch)
treea8a23a89cc89fefae7ed7b5253e559e5086728cd /Userland/Services/WebDriver/Session.h
parentae1611aa08d9cc89b2ce51c344a57905c9cb0f4a (diff)
downloadserenity-7be8931ca04c1bad04b1a0e6b46ab3b384a54970.zip
WebDriver: Defer removing closed window handles until no longer needed
WebDriver::Session::close_window may invoke Session::stop, which needs the WebContent connection to still exist. Do not remove the window's handle (thus destroying the connection) until it is no longer needed.
Diffstat (limited to 'Userland/Services/WebDriver/Session.h')
-rw-r--r--Userland/Services/WebDriver/Session.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/Userland/Services/WebDriver/Session.h b/Userland/Services/WebDriver/Session.h
index 49467af9ad..a42e70589a 100644
--- a/Userland/Services/WebDriver/Session.h
+++ b/Userland/Services/WebDriver/Session.h
@@ -36,8 +36,10 @@ public:
WebContentConnection& web_content_connection() const
{
- auto const& current_window = m_windows.get(m_current_window_handle).value();
- return current_window.web_content_connection;
+ auto current_window = m_windows.get(m_current_window_handle);
+ VERIFY(current_window.has_value());
+
+ return current_window->web_content_connection;
}
String const& current_window_handle() const