log: handle logging of NULL object

This commit is contained in:
Wim Taymans 2020-05-13 15:37:39 +02:00
parent 56730197d9
commit b4112968cf

View file

@ -338,9 +338,13 @@ void pw_log_log_object(enum spa_log_level level,
struct log_ctx ctx = { level, file, 0, func, }; struct log_ctx ctx = { level, file, 0, func, };
if (flags & PW_LOG_OBJECT_POD) { if (flags & PW_LOG_OBJECT_POD) {
const struct spa_pod *pod = object; const struct spa_pod *pod = object;
log_pod_value(&ctx, 0, SPA_TYPE_ROOT, if (pod == NULL) {
SPA_POD_TYPE(pod), pw_log_log(level, file, line, func, "NULL");
SPA_POD_BODY(pod), } else {
SPA_POD_BODY_SIZE(pod)); log_pod_value(&ctx, 0, SPA_TYPE_ROOT,
SPA_POD_TYPE(pod),
SPA_POD_BODY(pod),
SPA_POD_BODY_SIZE(pod));
}
} }
} }