File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -180,13 +180,15 @@ export function initialise(context: vscode.ExtensionContext) {
180
180
const statement = statementDetail . statement ;
181
181
182
182
if ( statement . type === StatementType . Create || statement . type === StatementType . Alter ) {
183
- const refs = statement . getObjectReferences ( ) ;
184
- const ref = refs [ 0 ] ;
185
- const databaseObj =
186
- statement . type === StatementType . Create && ref . createType . toUpperCase ( ) === `schema`
187
- ? ref . object . schema || ``
188
- : ref . object . schema + ref . object . name ;
189
- changedCache . add ( ( databaseObj || `` ) . toUpperCase ( ) ) ;
183
+ const refs = statement . getObjectReferences ( ) ;
184
+ if ( refs . length > 0 ) {
185
+ const ref = refs [ 0 ] ;
186
+ const databaseObj =
187
+ statement . type === StatementType . Create && ref . createType . toUpperCase ( ) === `schema`
188
+ ? ref . object . schema || ``
189
+ : ref . object . schema + ref . object . name ;
190
+ changedCache . add ( ( databaseObj || `` ) . toUpperCase ( ) ) ;
191
+ }
190
192
}
191
193
192
194
if ( statementDetail . content . trim ( ) . length > 0 ) {
You can’t perform that action at this time.
0 commit comments