summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rexmpp.c5
-rw-r--r--src/rexmpp.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/src/rexmpp.c b/src/rexmpp.c
index 04ec798..c9ec44e 100644
--- a/src/rexmpp.c
+++ b/src/rexmpp.c
@@ -101,6 +101,11 @@ rexmpp_err_t rexmpp_init (rexmpp_t *s,
s->xml_in_cb = xml_in_cb;
s->xml_out_cb = xml_out_cb;
+ if (jid == NULL) {
+ rexmpp_log(s, LOG_CRIT, "No initial JID is provided.");
+ return REXMPP_E_JID;
+ }
+
s->xml_parser = xmlCreatePushParserCtxt(&sax, s, "", 0, NULL);
if (s->xml_parser == NULL) {
diff --git a/src/rexmpp.h b/src/rexmpp.h
index 662d540..8c006e9 100644
--- a/src/rexmpp.h
+++ b/src/rexmpp.h
@@ -129,6 +129,8 @@ enum rexmpp_err {
REXMPP_E_DNS,
/** XML-related error. */
REXMPP_E_XML,
+ /** JID-related error. */
+ REXMPP_E_JID,
/** Failure to allocate memory. */
REXMPP_E_MALLOC
};