fix NPE when setting DistanceUnitAdapter