fix crash on swap sensor when the value returned is zero