Skip to content

Commit ef12f4f

Browse files
Debug session with Andrew and Musab
Co-authored by: Marc Jaramillo mnj.webdeveloper@gmail.com Co-authored by: Musab Guma'a mgsium@github.com:
1 parent 7fb59a3 commit ef12f4f

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

extensions/ql-vscode/src/databaseFetcher.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ async function readAndUnzip(
268268
step: 9,
269269
message: `Unzipping into ${path.basename(unzipPath)}`
270270
});
271-
if (cli !== undefined && await cli.cliConstraints.supportsDatabaseUnbundle()) {
271+
if (cli && await cli.cliConstraints.supportsDatabaseUnbundle()) {
272272
// Use the `database unbundle` command if the installed cli version supports it
273273
await cli.databaseUnbundle(zipFile, unzipPath);
274274
} else {
@@ -312,9 +312,9 @@ async function fetchAndUnzip(
312312
.on('finish', resolve)
313313
.on('error', reject)
314314
);
315-
if (cli && await cli.cliConstraints.supportsDatabaseUnbundle()) {
316-
await readAndUnzip(Uri.file(archivePath).toString(true), unzipPath, cli, progress);
317-
}
315+
316+
await readAndUnzip(Uri.file(archivePath).toString(true), unzipPath, cli, progress);
317+
318318

319319
// remove archivePath eagerly since these archives can be large.
320320
await fs.remove(archivePath);

extensions/ql-vscode/src/databases-ui.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ export class DatabaseUI extends DisposableObject {
452452
progress: ProgressCallback,
453453
token: CancellationToken
454454
): Promise<DatabaseItem | undefined> => {
455-
if (this.queryServer !== undefined && await this.queryServer.cliServer.cliConstraints.supportsDatabaseUnbundle()) {
455+
if (this.queryServer && await this.queryServer.cliServer.cliConstraints.supportsDatabaseUnbundle()) {
456456
return await promptImportInternetDatabase(
457457
this.databaseManager,
458458
this.storagePath,
@@ -475,7 +475,7 @@ export class DatabaseUI extends DisposableObject {
475475
token: CancellationToken
476476
): Promise<DatabaseItem | undefined> => {
477477

478-
if (this.queryServer !== undefined && await this.queryServer.cliServer.cliConstraints.supportsDatabaseUnbundle()) {
478+
if (this.queryServer && await this.queryServer.cliServer.cliConstraints.supportsDatabaseUnbundle()) {
479479
return await promptImportLgtmDatabase(
480480
this.databaseManager,
481481
this.storagePath,

0 commit comments

Comments
 (0)