Check GridSize for 0

Fixes CID 68226 and CID 66437