fix bug: handle null values in conversion method