Avoid a dangerous zero.
Merge pull request #4643 from shenweip/patch-9

minor fix:Avoid a dangerous zero.