Disable replies if a command's room is nil

This is implemented to prevent crashes on headless start, where
verification is performed without a specific room.
This commit is contained in:
FIGBERT 2023-06-24 12:42:03 +03:00
parent e4c71fde7c
commit 89dd9f9a6a
No known key found for this signature in database
GPG key ID: 67F1598D607A844B

View file

@ -53,7 +53,9 @@ func (cmd *Command) Reply(message string, args ...interface{}) {
if len(args) > 0 { if len(args) > 0 {
message = fmt.Sprintf(message, args...) message = fmt.Sprintf(message, args...)
} }
cmd.Room.AddServiceMessage(message) if cmd.Room != nil {
cmd.Room.AddServiceMessage(message)
}
cmd.UI.Render() cmd.UI.Render()
} }