Make getActiveClient throw an error if disconnected
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user