Skip to content

Commit 57d856f

Browse files
committed
Avoid displaying irrelevant error
Problem was misplaced parens. We were not waiting for the call to `pathExists` to complete before making the call to `stat` the directory. When the directory does not exist, then `stat` throws an error.
1 parent 343e9e5 commit 57d856f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

extensions/ql-vscode/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## [UNRELEASED]
44

5+
- Avoid displaying an error when removing orphaned databases and the storage folder does not exist. [#748](https://github.com/github/vscode-codeql/pull/748)
6+
57
## 1.4.2 - 2 February 2021
68

79
- Add a status bar item for the CodeQL CLI to show the current version. [#741](https://github.com/github/vscode-codeql/pull/741)

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,8 @@ export class DatabaseUI extends DisposableObject {
379379
let dbDirs = undefined;
380380

381381
if (
382-
!(await fs.pathExists(this.storagePath) ||
383-
!(await fs.stat(this.storagePath)).isDirectory())
382+
!(await fs.pathExists(this.storagePath)) ||
383+
!(await fs.stat(this.storagePath)).isDirectory()
384384
) {
385385
logger.log('Missing or invalid storage directory. Not trying to remove orphaned databases.');
386386
return;

0 commit comments

Comments
 (0)