Fix #68 - NPE in Regions Utils - add null pointer check when measuring

distance to a region during automatic region detection, and skip the
current region if the distance to it can't be measured.