PageDaoSqlite::find: Return empty if not page found
Šī revīzija ir iekļauta:
vecāks
6aadd43ff4
revīzija
ebdb71343c
@ -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)
|
||||
|
Notiek ielāde…
Atsaukties uz šo jaunā problēmā
Block a user