diff --git a/desktop/plugins/public/databases/index.tsx b/desktop/plugins/public/databases/index.tsx index e2785a607..d5f20076b 100644 --- a/desktop/plugins/public/databases/index.tsx +++ b/desktop/plugins/public/databases/index.tsx @@ -116,6 +116,8 @@ export function plugin(client: PluginClient) { (Object.values(databases)[0] ? Object.values(databases)[0].id : 0); const selectedTable = state.selectedDatabaseTable && + selectedDatabase > 0 && + databases.length >= selectedDatabase && databases[selectedDatabase - 1].tables.includes( state.selectedDatabaseTable, )