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