mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
Protect against null as revealed by npm test
This commit is contained in:
parent
be78e3c224
commit
6049f60a05
1 changed files with 7 additions and 2 deletions
|
@ -111,8 +111,13 @@ export class CargoWatchProvider implements vscode.Disposable {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!this.cargoProcess) {
|
||||||
|
vscode.window.showErrorMessage('Cargo Watch failed to start');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const stdoutData = new LineBuffer();
|
const stdoutData = new LineBuffer();
|
||||||
this.cargoProcess.stdout.on('data', (s: string) => {
|
this.cargoProcess.stdout?.on('data', (s: string) => {
|
||||||
stdoutData.processOutput(s, line => {
|
stdoutData.processOutput(s, line => {
|
||||||
this.logInfo(line);
|
this.logInfo(line);
|
||||||
try {
|
try {
|
||||||
|
@ -124,7 +129,7 @@ export class CargoWatchProvider implements vscode.Disposable {
|
||||||
});
|
});
|
||||||
|
|
||||||
const stderrData = new LineBuffer();
|
const stderrData = new LineBuffer();
|
||||||
this.cargoProcess.stderr.on('data', (s: string) => {
|
this.cargoProcess.stderr?.on('data', (s: string) => {
|
||||||
stderrData.processOutput(s, line => {
|
stderrData.processOutput(s, line => {
|
||||||
this.logError('Error on cargo-watch : {\n' + line + '}\n');
|
this.logError('Error on cargo-watch : {\n' + line + '}\n');
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue