Catch null return value and report missing key instead of running into Exception

Did not get a proper error message for certain keys, so I added a null check