summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-09-21 13:04:59 +0200
committerAndreas Kling <kling@serenityos.org>2022-09-21 13:06:17 +0200
commit4814e1bd650adf151f6f4c76d752a5a956e1f332 (patch)
treef13c3d558b68ffdbfb531ca0ae01c945db2cff5a /Userland
parent2b69af2dfe9ae2abaadee320878742a5c216deb4 (diff)
downloadserenity-4814e1bd650adf151f6f4c76d752a5a956e1f332.zip
Browser: Ignore title updates when history has no current item
The Browser::History class is oblivious to the state of the browsing context's session history over on the LibWeb side. We need to hook a lot more thing up here, but for now just ignore updates when there's no current history item. This fixes a VERIFY() error on startup.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Applications/Browser/History.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Applications/Browser/History.cpp b/Userland/Applications/Browser/History.cpp
index 7732c6f5d7..bddd81267c 100644
--- a/Userland/Applications/Browser/History.cpp
+++ b/Userland/Applications/Browser/History.cpp
@@ -57,6 +57,8 @@ void History::clear()
void History::update_title(String const& title)
{
+ if (m_current == -1)
+ return;
m_items[m_current].title = title;
}