c
if (partner == NULL)
    return NULL;  // or handle the error appropriately
