diff --git a/database/pagedaosqlite.cpp b/database/pagedaosqlite.cpp index db19a04..69cdae7 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)