diff --git a/src/authd.cr b/src/authd.cr index 1f63015..deb7e2d 100644 --- a/src/authd.cr +++ b/src/authd.cr @@ -582,7 +582,11 @@ end class IPC::Client def send(request : AuthD::Request) - send @server_fd, request.type.to_u8, request.to_json + unless (fd = @server_fd).nil? + send fd, request.type.to_u8, request.to_json + else + raise "Client not connected to the server" + end end end