common: guard against undefined backStack/forwardStack in TabSessionHistory (#9674)

Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
01zulfi
2026-04-06 12:42:00 +05:00
committed by GitHub
parent 267fe4e453
commit d49d42b736

View File

@@ -163,13 +163,13 @@ export class TabSessionHistory {
canGoBack(id: string) {
const tabHistory = this.options.get().tabSessionHistory[id];
if (!tabHistory) return false;
if (!tabHistory || !tabHistory.backStack) return false;
return tabHistory.backStack.length > 1;
}
canGoForward(id: string) {
const tabHistory = this.options.get().tabSessionHistory[id];
if (!tabHistory) return false;
if (!tabHistory || !tabHistory.forwardStack) return false;
return tabHistory.forwardStack.length >= 1;
}
}