Fix serialization not working when active_tab_history is empty

This commit is contained in:
Kovid Goyal 2025-08-12 15:38:34 +05:30
parent a8eacd500c
commit db584694ad
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -1189,7 +1189,7 @@ def serialize_state(self) -> dict[str, Any]:
def serialize_state_as_session(self) -> list[str]:
tmap = {tab.id: tab for tab in self}
ans = []
for tab_id in self.active_tab_history:
for tab_id in self.active_tab_history or tmap:
tab = tmap.get(tab_id)
if tab is not None:
ans.extend(tab.serialize_state_as_session())