Handling entry not found.

This commit is contained in:
Louis-Bertrand Varin 2017-03-12 13:37:20 -04:00 committed by Louis-Bertrand Varin
parent 15c2727a1d
commit db1bf88934

View File

@ -78,6 +78,11 @@ int Show::execute(int argc, char **argv)
Uuid uuid = Uuid::fromHex(args.at(1));
Entry* entry = db->resolveEntry(uuid);
if (entry == nullptr) {
qCritical("No entry found with uuid %s", qPrintable(uuid.toHex()));
return EXIT_FAILURE;
}
out << entry->password() << "\n";
return EXIT_SUCCESS;
}