diff --git a/packages/web/src/appobj/DatabaseAppObject.svelte b/packages/web/src/appobj/DatabaseAppObject.svelte index d9f45aef8..dec53e73a 100644 --- a/packages/web/src/appobj/DatabaseAppObject.svelte +++ b/packages/web/src/appobj/DatabaseAppObject.svelte @@ -243,7 +243,7 @@ tabComponent: 'QueryDesignTab', focused: true, props: { - conid: connection._id, + conid: connection?._id, database: name, }, }); @@ -255,7 +255,7 @@ icon: 'img perspective', tabComponent: 'PerspectiveTab', props: { - conid: connection._id, + conid: connection?._id, database: name, }, }); @@ -267,14 +267,14 @@ icon: 'img profiler', tabComponent: 'ProfilerTab', props: { - conid: connection._id, + conid: connection?._id, database: name, }, }); }; const handleRefreshSchemas = () => { - const conid = connection._id; + const conid = connection?._id; const database = name; apiCall('database-connections/dispatch-database-changed-event', { event: 'schema-list-changed', @@ -285,7 +285,7 @@ }; async function handleConfirmSql(sql) { - saveScriptToDatabase({ conid: connection._id, database: name }, sql, false); + saveScriptToDatabase({ conid: connection?._id, database: name }, sql, false); } const handleGenerateDropAllObjectsScript = () => { @@ -559,7 +559,7 @@ await dbgateApi.dropAllDbObjects(${JSON.stringify( : $lockedDatabaseMode ? getNumberIcon( $openedTabs.filter( - x => !x.closedTime && x.props.conid == data?.connection?._id && x.props.database == data?.name + x => !x.closedTime && x.props?.conid == data?.connection?._id && x.props?.database == data?.name ).length ) : ''}