summaryrefslogtreecommitdiff
path: root/src/database
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2018-03-23 15:54:36 +0100
committerlouiz’ <louiz@louiz.org>2018-03-23 15:54:36 +0100
commitcdace80758e2ee41f33824ad7f52a369c42a4a89 (patch)
tree4ae2d5ea0bd101c57a11832bc730259d9a93a9ab /src/database
parentfaa33c1a712f98de4bafee821bde7eb270bbb7f7 (diff)
downloadbiboumi-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/database')
-rw-r--r--src/database/select_query.hpp2
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)