From dcd2a6bec6eb78e9f410dbe24669713300bfc1e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Thu, 7 Apr 2022 23:57:28 +0200 Subject: [PATCH] Don't panic if terminal does not exist --- lapce-proxy/src/dispatch.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lapce-proxy/src/dispatch.rs b/lapce-proxy/src/dispatch.rs index 509c556a..2ae0243c 100644 --- a/lapce-proxy/src/dispatch.rs +++ b/lapce-proxy/src/dispatch.rs @@ -342,10 +342,10 @@ fn handle_notification(&self, rpc: ProxyNotification) { } TerminalWrite { term_id, content } => { let terminals = self.terminals.lock(); - let tx = terminals.get(&term_id).unwrap(); - - #[allow(deprecated)] - let _ = tx.send(Msg::Input(content.into_bytes().into())); + if let Some(tx) = terminals.get(&term_id) { + #[allow(deprecated)] + let _ = tx.send(Msg::Input(content.into_bytes().into())); + } } TerminalResize { term_id, @@ -445,7 +445,7 @@ fn handle_request(&self, id: RequestId, rpc: ProxyRequest) { let buffer = buffers.get(&buffer_id).unwrap(); self.lsp.lock().get_hover(id, request_id, buffer, position); } - GetSignature { + GetSignature { buffer_id, position, } => {