Skip to content

Commit

Permalink
Only read AdditionalRemoteLogs if remoteLogsUri is valid
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanp413 committed Oct 9, 2023
1 parent 9114c6f commit 19d1779
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/commands/logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,20 @@ export class ExportLogsCommand implements Command {
if (token.isCancellationRequested) {
return;
}
}

for (const logFilePath of this.getAdditionalRemoteLogs()) {
try {
const logFileUri = vscode.Uri.file(logFilePath).with({ scheme: 'vscode-remote' });
const fileContent = await vscode.workspace.fs.readFile(logFileUri);
if (fileContent.byteLength > 0) {
remoteLogFiles.push({
path: path.join('./remote', path.basename(logFileUri.path)),
contents: Buffer.from(fileContent)
});
for (const logFilePath of this.getAdditionalRemoteLogs()) {
try {
const logFileUri = vscode.Uri.file(logFilePath).with({ scheme: 'vscode-remote' });
const fileContent = await vscode.workspace.fs.readFile(logFileUri);
if (fileContent.byteLength > 0) {
remoteLogFiles.push({
path: path.join('./remote', path.basename(logFileUri.path)),
contents: Buffer.from(fileContent)
});
}
} catch {
// no-op
}
} catch {
// no-op
}
}

Expand Down

0 comments on commit 19d1779

Please sign in to comment.