summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-02-28 10:24:45 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-02-28 10:24:45 -0600
commit9c714b03f98f1bb64db1f24c79f9831365bbf111 (patch)
tree844dd87f59a4770327a49166f38e74c184a02e87
parent6ebdcfe27d5a44cc7ec1840ea0295e9ad87ff2fe (diff)
parentee0a123f436042ac685b8046949e45726ae161c9 (diff)
Merge "res_pjsip: Fix crash when contact has no status"
-rw-r--r--res/res_pjsip/pjsip_options.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/res/res_pjsip/pjsip_options.c b/res/res_pjsip/pjsip_options.c
index 6fd3c2575..662166c89 100644
--- a/res/res_pjsip/pjsip_options.c
+++ b/res/res_pjsip/pjsip_options.c
@@ -1250,8 +1250,8 @@ int ast_sip_format_contact_ami(void *obj, void *arg, int flags)
if (!ast_strlen_zero(contact->call_id)) {
ast_str_append(&buf, 0, "CallID: %s\r\n", contact->call_id);
}
- ast_str_append(&buf, 0, "Status: %s\r\n", ast_sip_get_contact_status_label(status->status));
- if (status->status == UNKNOWN) {
+ ast_str_append(&buf, 0, "Status: %s\r\n", ast_sip_get_contact_status_label(status ? status->status : UNKNOWN));
+ if (!status || status->status == UNKNOWN) {
ast_str_append(&buf, 0, "RoundtripUsec: N/A\r\n");
} else {
ast_str_append(&buf, 0, "RoundtripUsec: %" PRId64 "\r\n", status->rtt);