From 98d25607a9ca9ce499540e3c34ee819e0ea2480a Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 26 Dec 2017 02:22:09 -0800 Subject: [PATCH] Prevent exception when setting bellSound before open Fixes #1165 --- src/Terminal.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Terminal.ts b/src/Terminal.ts index b685c8cd..ce683912 100644 --- a/src/Terminal.ts +++ b/src/Terminal.ts @@ -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()) {