get_warnings_attr(): Fix coverity warning

Don't check if the dict key exists before getting the key. Instead get the key
and handle error.
1 file changed