fixes issue with differnet json gems causing errors not to be handled

A different JSON gem such as yajl-ruby computes `JSON.parse('')` as `nil` instead of raising an exception.