How to check if a key exists within a JSON file

Hi, I’m importing a JSON file using an API. For most elements within the array the key “rating” exists, for some it doesn’t. At that point my code stops with a null pointer exception. I’m trying to do a check whether a key exists, in other languages I learned about the .has() function but that doesn’t seem to work here. Any idea how I could do that within the Processing environment?

Can you check
myVar==null

or != null?