mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-30 08:53:08 +01:00
WebSockets: throw error if trying to send() before open() in MessageChannel
This commit is contained in:
parent
7aca159017
commit
bfcba85336
1 changed files with 5 additions and 1 deletions
|
|
@ -61,7 +61,11 @@ export class MessageChannel {
|
|||
}
|
||||
|
||||
send (msg) {
|
||||
this.socket.send(msg.toJsonText());
|
||||
if (this.socket) {
|
||||
this.socket.send(msg.toJsonText());
|
||||
} else {
|
||||
throw Error('MessageChannel: cannot call send() before open()');
|
||||
}
|
||||
}
|
||||
|
||||
closeCallback () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue