summaryrefslogtreecommitdiff
path: root/modules/contact/contact.c
diff options
context:
space:
mode:
authorAlfred E. Heggestad <aeh@db.org>2016-08-16 19:16:20 +0200
committerAlfred E. Heggestad <aeh@db.org>2016-08-16 19:16:20 +0200
commitecf430548c909657eee0b63dcf0b77d68328a1a7 (patch)
tree0c94eb1405a0ae18ce9d69e81c9abe23bf54882f /modules/contact/contact.c
parent0dac038f7eb90533c0ffee8a673975d735b28a0e (diff)
contact: check if chat_peer is set
Diffstat (limited to 'modules/contact/contact.c')
-rw-r--r--modules/contact/contact.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/contact/contact.c b/modules/contact/contact.c
index 918d9a3..8b25652 100644
--- a/modules/contact/contact.c
+++ b/modules/contact/contact.c
@@ -115,11 +115,14 @@ static int cmd_message(struct re_printf *pf, void *arg)
const struct cmd_arg *carg = arg;
int err;
- (void)pf;
+ if (!str_isset(chat_peer)) {
+ return re_hprintf(pf, "contact: chat peer is not set\n");
+ }
err = message_send(uag_current(), chat_peer, carg->prm);
if (err) {
- (void)re_hprintf(pf, "chat: ua_im_send() failed (%m)\n", err);
+ (void)re_hprintf(pf, "contact: message_send() failed (%m)\n",
+ err);
}
return err;