From 9067b5a1686b77dfd2991691867034ee201fa2a3 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 3 Jun 2021 10:13:24 +0200 Subject: [PATCH] Make getActiveClient throw an error if disconnected --- commands.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands.js b/commands.js index 25de7f2..ab9a5fa 100644 --- a/commands.js +++ b/commands.js @@ -4,7 +4,7 @@ import { SERVER_BUFFER, BufferType } from "./state.js"; function getActiveClient(app) { var buf = app.state.buffers.get(app.state.activeBuffer); if (!buf) { - return null; + throw new Error("Not connected to server"); } return app.clients.get(buf.network); }