Fixed (undefined) use of null object.

Added test against null, which was already being done
in the 'enabling' branch.

Caught by clang's ubsan.

Change-Id: I6ecb400103020b54dda18bd7062f43ba82854ac3
Fixed (undefined) use of null object.

Changed a probable typo from: newLines to newPolys

Caught by clang's ubsan.

Change-Id: I9a4a2aefb2d118d23bd0adb54a3332abc1eb500e
Merge topic 'sanitize-null' into master

fb8c7848 Fixed (undefined) use of null object.
6ffd3241 Fixed (undefined) use of null object.