[fix] protect a potential division by zero