Check that db.prepare worked before using the returned statement
This commit is contained in:
@@ -115,6 +115,8 @@ struct SelectQuery: public Query
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
auto statement = db.prepare(this->body);
|
auto statement = db.prepare(this->body);
|
||||||
|
if (!statement)
|
||||||
|
return rows;
|
||||||
statement->bind(std::move(this->params));
|
statement->bind(std::move(this->params));
|
||||||
|
|
||||||
while (statement->step() == StepResult::Row)
|
while (statement->step() == StepResult::Row)
|
||||||
|
|||||||
Reference in New Issue
Block a user