diff --git a/database/pagedaosqlite.cpp b/database/pagedaosqlite.cpp index 3de7e0d..2790cfa 100644 --- a/database/pagedaosqlite.cpp +++ b/database/pagedaosqlite.cpp @@ -40,8 +40,15 @@ bool PageDaoSqlite::exists(std::string name) const std::optional PageDaoSqlite::find(std::string name) { - int pageid = fetchPageId(name); - return find(pageid); + try + { + int pageid = fetchPageId(name); + return find(pageid); + } + catch(const sqlite::errors::no_rows &e) + { + return { }; + } } std::optional PageDaoSqlite::find(unsigned int id)