oh sorry wrong function, isset is required. So this is correct:
if (isset($user_ids) && !empty($user_ids))