Commit d51375aa authored by Scott Vokes's avatar Scott Vokes Committed by Greg Williams
Browse files

Add asserts to provide better details on NULL result pointers.

These should be safely filtered out upstream now, but this will
log better root cause info if any of them are NULL for other reasons.
parent e12892fb
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -250,12 +250,17 @@ void KineticController_HandleUnexpectedResponse(void *msg,
void KineticController_HandleResult(bus_msg_result_t *res, void *udata)
{
    KineticOperation* op = udata;
    KINETIC_ASSERT(op);
    KINETIC_ASSERT(op->connection);

    KineticStatus status = bus_to_kinetic_status(res->status);

    if (status == KINETIC_STATUS_SUCCESS) {

        KineticResponse * response = res->u.response.opaque_msg;
        KINETIC_ASSERT(response);
        KINETIC_ASSERT(response->command);
        KINETIC_ASSERT(response->command->header);

        if (response->command != NULL &&
            response->command->status != NULL &&
            response->command->status->has_code)