Don't panic if terminal does not exist

This commit is contained in:
Dániel Buga 2022-04-07 23:57:28 +02:00
parent 1336fa00b4
commit dcd2a6bec6
1 changed files with 5 additions and 5 deletions

View File

@ -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,
} => {