From cdace80758e2ee41f33824ad7f52a369c42a4a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Fri, 23 Mar 2018 15:54:36 +0100 Subject: Check that db.prepare worked before using the returned statement --- src/database/select_query.hpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') 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) -- cgit v1.2.3