oc_collection: add NULL check
@@ -816,7 +816,7 @@ oc_handle_collection_request(oc_method_t method, oc_request_t *request,
}
pay = pay->next;
}
- if (oc_string_len(*href) == 0) {
+ if (!href || (href && oc_string_len(*href) == 0)) {
ecode = oc_status_code(OC_STATUS_BAD_REQUEST);
goto processed_request;
}
