Skip to content

Commit

Permalink
Avoid displaying irrelevant error
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aeisenberg committed Feb 9, 2021
1 parent 47b57c0 commit a636900
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions extensions/ql-vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [UNRELEASED]

- Avoid displaying an error when removing orphaned databases and the storage folder does not exist. [#748](https://github.com/github/vscode-codeql/pull/748)

## 1.4.2 - 2 February 2021

- Add a status bar item for the CodeQL CLI to show the current version. [#741](https://github.com/github/vscode-codeql/pull/741)
Expand Down
4 changes: 2 additions & 2 deletions extensions/ql-vscode/src/databases-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,8 @@ export class DatabaseUI extends DisposableObject {
let dbDirs = undefined;

if (
!(await fs.pathExists(this.storagePath) ||
!(await fs.stat(this.storagePath)).isDirectory())
!(await fs.pathExists(this.storagePath)) ||
!(await fs.stat(this.storagePath)).isDirectory()
) {
logger.log('Missing or invalid storage directory. Not trying to remove orphaned databases.');
return;
Expand Down

0 comments on commit a636900

Please sign in to comment.