Replace undefined check with length check

This commit is contained in:
Elena Tanasoiu
2023-01-31 17:02:41 +00:00
parent 6257608433
commit b6aa41d19b

View File

@@ -363,7 +363,7 @@ export class DatabaseUI extends DisposableObject {
token: CancellationToken,
): Promise<void> => {
try {
if (workspace.workspaceFolders === undefined) {
if (!workspace.workspaceFolders?.length) {
throw new Error("No workspace folder is open.");
} else {
// This specifically refers to the database folder in