Check null since JSON.parse can't handle nulls.

JSON.parse can't handle null parameters.
This can cause unexpected behavior (especially in chrome for Android and IE11)