Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit 992bdad

Browse files
committed
Add check for availability of _serialPortCtrl
1 parent 09079dd commit 992bdad

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/serialmonitor/serialMonitor.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ export class SerialMonitor implements vscode.Disposable {
232232
Logger.warn("No timestamp format inputted, keeping previous timestamp format.");
233233
return;
234234
}
235+
if (!this._serialPortCtrl) {
236+
Logger.warn("Serial Monitor has not been started.");
237+
return;
238+
}
235239
await this._serialPortCtrl.changeTimestampFormat(timestampFormat);
236240
this._currentTimestampFormat = timestampFormat;
237241
this._timestampFormatStatusBar.tooltip = `Timestamp Format: "${timestampFormat}"`;

0 commit comments

Comments
 (0)