add assert and note on getCurrentEntry

This commit is contained in:
Muki Kiboigo
2025-12-09 15:17:54 -08:00
parent 3662d1681e
commit ddb83cf9c5

View File

@@ -72,6 +72,10 @@ pub fn getCanGoForward(self: *const Navigation) bool {
} }
pub fn getCurrentEntry(self: *Navigation) *NavigationHistoryEntry { pub fn getCurrentEntry(self: *Navigation) *NavigationHistoryEntry {
// This should never fail. An entry should always be created before
// we run the scripts on the page we are loading.
std.debug.assert(self._entries.items.len > 0);
return self._entries.items[self._index]; return self._entries.items[self._index];
} }