Check for keys existing before getting them.

Signed-off-by: Ian Main <imain@redhat.com>