fixed potential NaN issue https://github.com/NodeBB/NodeBB/issues/2077