[utils] Add None check in str_to_int