Fix a nullref if an unknown unit type is present in the statistics

Found by coverity