Check to make sure key exists in tag list before using it

Fixes #7910