Skip to content

Commit 19d1779

Browse files
committed
Only read AdditionalRemoteLogs if remoteLogsUri is valid
1 parent 9114c6f commit 19d1779

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/commands/logs.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,20 +110,20 @@ export class ExportLogsCommand implements Command {
110110
if (token.isCancellationRequested) {
111111
return;
112112
}
113-
}
114113

115-
for (const logFilePath of this.getAdditionalRemoteLogs()) {
116-
try {
117-
const logFileUri = vscode.Uri.file(logFilePath).with({ scheme: 'vscode-remote' });
118-
const fileContent = await vscode.workspace.fs.readFile(logFileUri);
119-
if (fileContent.byteLength > 0) {
120-
remoteLogFiles.push({
121-
path: path.join('./remote', path.basename(logFileUri.path)),
122-
contents: Buffer.from(fileContent)
123-
});
114+
for (const logFilePath of this.getAdditionalRemoteLogs()) {
115+
try {
116+
const logFileUri = vscode.Uri.file(logFilePath).with({ scheme: 'vscode-remote' });
117+
const fileContent = await vscode.workspace.fs.readFile(logFileUri);
118+
if (fileContent.byteLength > 0) {
119+
remoteLogFiles.push({
120+
path: path.join('./remote', path.basename(logFileUri.path)),
121+
contents: Buffer.from(fileContent)
122+
});
123+
}
124+
} catch {
125+
// no-op
124126
}
125-
} catch {
126-
// no-op
127127
}
128128
}
129129

0 commit comments

Comments
 (0)