diff options
author | louiz’ <louiz@louiz.org> | 2018-03-23 15:54:36 +0100 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2018-03-23 15:54:36 +0100 |
commit | cdace80758e2ee41f33824ad7f52a369c42a4a89 (patch) | |
tree | 4ae2d5ea0bd101c57a11832bc730259d9a93a9ab /src | |
parent | faa33c1a712f98de4bafee821bde7eb270bbb7f7 (diff) | |
download | biboumi-cdace80758e2ee41f33824ad7f52a369c42a4a89.tar.gz biboumi-cdace80758e2ee41f33824ad7f52a369c42a4a89.tar.bz2 biboumi-cdace80758e2ee41f33824ad7f52a369c42a4a89.tar.xz biboumi-cdace80758e2ee41f33824ad7f52a369c42a4a89.zip |
Check that db.prepare worked before using the returned statement
Diffstat (limited to 'src')
-rw-r--r-- | src/database/select_query.hpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/database/select_query.hpp b/src/database/select_query.hpp index 5a17f38..743a011 100644 --- a/src/database/select_query.hpp +++ b/src/database/select_query.hpp @@ -115,6 +115,8 @@ struct SelectQuery: public Query #endif auto statement = db.prepare(this->body); + if (!statement) + return rows; statement->bind(std::move(this->params)); while (statement->step() == StepResult::Row) |