fix(client): exit client-loop on empty message receive (#1454)

This commit is contained in:
Spyros Roum 2022-06-06 10:30:26 +03:00 committed by GitHub
parent e75b8da1ff
commit 496196214a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,7 +16,7 @@ use zellij_utils::{
command::TerminalAction,
get_mode_info,
},
ipc::{ClientToServerMsg, IpcReceiverWithContext, ServerToClientMsg},
ipc::{ClientToServerMsg, ExitReason, IpcReceiverWithContext, ServerToClientMsg},
};
use crate::ClientId;
@ -520,6 +520,13 @@ pub(crate) fn route_thread_main(
}
None => {
log::error!("Received empty message from client");
os_input.send_to_client(
client_id,
ServerToClientMsg::Exit(ExitReason::Error(
"Received empty message".to_string(),
)),
);
break;
}
}
}