Base: Check input before running JSON.parse()

Older browsers and specifically Android 2.2 can’t handle a
JSON.parse(null)