File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -211,6 +211,12 @@ export class AwsMySQLClient extends AwsClient {
211
211
}
212
212
213
213
async end ( ) {
214
+ if ( ! this . isConnected || ! this . targetClient ?. client ) {
215
+ // No connections has been initialized.
216
+ // This might happen if end is called in a finally block when an error occurred while initializing the first connection.
217
+ return ;
218
+ }
219
+
214
220
const hostInfo : HostInfo | null = this . pluginService . getCurrentHostInfo ( ) ;
215
221
const result = await this . pluginManager . execute (
216
222
this . pluginService . getCurrentHostInfo ( ) ,
Original file line number Diff line number Diff line change @@ -192,6 +192,11 @@ export class AwsPGClient extends AwsClient {
192
192
}
193
193
194
194
async end ( ) {
195
+ if ( ! this . isConnected || ! this . targetClient ?. client ) {
196
+ // No connections has been initialized.
197
+ // This might happen if end is called in a finally block when an error occurred while initializing the first connection.
198
+ return ;
199
+ }
195
200
const hostInfo : HostInfo | null = this . pluginService . getCurrentHostInfo ( ) ;
196
201
const result = await this . pluginManager . execute (
197
202
hostInfo ,
You can’t perform that action at this time.
0 commit comments