ubusd: add missing NULL pointer checks for obj->type