Skip to content

Truly independent web browser

LibWebView: Assert a found same-document entry to replace is replaced

Shannon Booth62fe82150c0f
diff --git a/Libraries/LibWebView/CanonicalTraversable.cpp b/Libraries/LibWebView/CanonicalTraversable.cpp
index 89b6be13ab8..35d5e699905 100644
--- a/Libraries/LibWebView/CanonicalTraversable.cpp
+++ b/Libraries/LibWebView/CanonicalTraversable.cpp
@@ -2457,10 +2457,8 @@ void CanonicalTraversable::finalize_a_same_document_navigation(HistoryOperation&
// 5.1. Replace entryToReplace with targetEntry in targetEntries.
// 5.2. Set targetEntry's step to entryToReplace's step.
- if (!m_session_history.replace_session_history_entry(*target_navigable, **entry_to_replace, *target_entry)) {
- end_history_operation(operation.operation_id);
- return;
- }
+ auto replaced = m_session_history.replace_session_history_entry(*target_navigable, **entry_to_replace, *target_entry);
+ VERIFY(replaced);
// 5.3. Set targetStep to traversable's current session history step.
target_step = current_step;