``create`` accessed ``partner.user_ids[0]`` which raised ``IndexError`` when the ticket's partner had no linked user (e.g. a plain contact). Use ``partner.user_ids[:1]`` so a partner without a user yields an empty recordset, which the following ``if not user`` guard handles gracefully, leaving the ticket's team untouched.