PageDaoSqlite::find: Return empty if not page found
This commit is contained in:
父節點
c07d0f66ef
當前提交
a7137460f0
@ -40,8 +40,15 @@ bool PageDaoSqlite::exists(std::string name) const
|
||||
|
||||
std::optional<Page> 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<Page> PageDaoSqlite::find(unsigned int id)
|
||||
|
載入中…
新增問題並參考
Block a user