forked from CringeStudios/gamja
Make getActiveClient throw an error if disconnected
This commit is contained in:
parent
a4294975a2
commit
9067b5a168
@ -4,7 +4,7 @@ import { SERVER_BUFFER, BufferType } from "./state.js";
|
|||||||
function getActiveClient(app) {
|
function getActiveClient(app) {
|
||||||
var buf = app.state.buffers.get(app.state.activeBuffer);
|
var buf = app.state.buffers.get(app.state.activeBuffer);
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
return null;
|
throw new Error("Not connected to server");
|
||||||
}
|
}
|
||||||
return app.clients.get(buf.network);
|
return app.clients.get(buf.network);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user