Fix JSONGetMethod to prevent panics on bad input.

ok @jcvernaleo