Prevent exception when setting bellSound before open

Fixes #1165
This commit is contained in:
Daniel Imms
2017-12-26 02:22:09 -08:00
parent 9518d20c4e
commit 98d25607a9
+5
View File
@@ -2116,6 +2116,11 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
}
private syncBellSound(): void {
// Don't update anything if the terminal has not been opened yet
if (!this.element) {
return;
}
if (this.soundBell() && this.bellAudioElement) {
this.bellAudioElement.setAttribute('src', this.options.bellSound);
} else if (this.soundBell()) {