fix null ptr exception in unit conversion code