Skip to content

Commit a53d159

Browse files
Copilotvhvb1989
andcommitted
Fix validation to use strict equality check for undefined
Changed condition from `!selectedFile.fsPath` to `selectedFile.fsPath === undefined` to avoid incorrectly rejecting empty string paths which are valid for root directories. Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>
1 parent d866848 commit a53d159

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/vscode/src/commands/cmdUtil.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function validateFileSystemUri(
2828
selectedItem: vscode.Uri | TreeViewModel | undefined,
2929
commandName: string
3030
): void {
31-
if (selectedFile && !selectedFile.fsPath) {
31+
if (selectedFile && selectedFile.fsPath === undefined) {
3232
context.errorHandling.suppressReportIssue = true;
3333
const itemType = isTreeViewModel(selectedItem) ? 'TreeViewModel' :
3434
isAzureDevCliModel(selectedItem) ? 'AzureDevCliModel' :

0 commit comments

Comments
 (0)