- if (key->gotsigs == false) {
- key->sigs = config.dbbackend->getkeysigs(key->keyid, &revoked);
+ if (key == NULL || key->gotsigs == false) {
+ sigs = config.dbbackend->getkeysigs(keyid, &revoked);
+ if (sigs == NULL) {
+ return NULL;
+ }
+ if (key == NULL) {
+ key = createandaddtohash(keyid);
+ }
+ key->sigs = sigs;