PageDaoSqlite::find: Return empty if not page found
This commit is contained in:
parent
6aadd43ff4
commit
ebdb71343c
@ -39,10 +39,17 @@ bool PageDaoSqlite::exists(std::string name) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::optional<Page> PageDaoSqlite::find(std::string name)
|
std::optional<Page> PageDaoSqlite::find(std::string name)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
int pageid = fetchPageId(name);
|
int pageid = fetchPageId(name);
|
||||||
return find(pageid);
|
return find(pageid);
|
||||||
}
|
}
|
||||||
|
catch(const sqlite::errors::no_rows &e)
|
||||||
|
{
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::optional<Page> PageDaoSqlite::find(unsigned int id)
|
std::optional<Page> PageDaoSqlite::find(unsigned int id)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user