]> the.earth.li Git - onak.git/blobdiff - cgi/hashquery.c
Handle failed database initialisation more gracefully
[onak.git] / cgi / hashquery.c
index 7b8c6c4fa57360cee56e2d5c8e2d6a4d59b7cb1d..d750608b812342cc9160c70bc574ab73b42e0294 100644 (file)
@@ -94,6 +94,10 @@ int main(__unused int argc, __unused char *argv[])
        catchsignals();
        dbctx = config.dbinit(config.backend, false);
 
+       if (dbctx == NULL) {
+               doerror("Failed to open key database.");
+       }
+
        if (dbctx->fetch_key_skshash == NULL) {
                dbctx->cleanupdb(dbctx);
                doerror("Can't fetch by skshash with this backend.");