From 23946ff2cef6d63e1529e2c8c4357d7fdedc3284 Mon Sep 17 00:00:00 2001 From: Fabio Di Stasio Date: Thu, 28 Dec 2023 10:44:11 +0100 Subject: [PATCH] fix(PostgreSQL): exception deleting a table with one or less tabs open --- src/renderer/stores/workspaces.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/renderer/stores/workspaces.ts b/src/renderer/stores/workspaces.ts index 3ac67ec9..da671545 100644 --- a/src/renderer/stores/workspaces.ts +++ b/src/renderer/stores/workspaces.ts @@ -680,7 +680,8 @@ export const useWorkspacesStore = defineStore('workspaces', { if (!isSelectedExistent && workspace.tabs.length) { if (workspace.customizations.database) { const databaseTabs = workspace.tabs.filter(tab => tab.type === 'query' || tab.database === workspace.database); - this.selectTab({ uid, tab: databaseTabs[databaseTabs.length - 1].uid }); + if (databaseTabs.length) + this.selectTab({ uid, tab: databaseTabs[databaseTabs.length - 1].uid }); } else this.selectTab({ uid, tab: workspace.tabs[workspace.tabs.length - 1].uid });