add an assert to detect possible division by zero

issue found by coverity