mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-02-08 15:58:47 +01:00
Check return of QSqlQuery::prepare
This commit is contained in:
parent
eaed82c9b2
commit
75ab6f25f4
@ -210,7 +210,7 @@ bool CollectionQuery::Exec() {
|
||||
sql.replace("%fts_table_noprefix", fts_table_.section('.', -1, -1));
|
||||
sql.replace("%fts_table", fts_table_);
|
||||
|
||||
QSqlQuery::prepare(sql);
|
||||
if (!QSqlQuery::prepare(sql)) return false;
|
||||
|
||||
// Bind values
|
||||
for (const QVariant &value : bound_values_) {
|
||||
|
@ -60,7 +60,10 @@ void Console::RunQuery() {
|
||||
|
||||
QSqlDatabase db = app_->database()->Connect();
|
||||
QSqlQuery query(db);
|
||||
query.prepare(ui_.query->text());
|
||||
if (!query.prepare(ui_.query->text())) {
|
||||
qLog(Error) << query.lastError();
|
||||
return;
|
||||
}
|
||||
if (!query.exec()) {
|
||||
qLog(Error) << query.lastError();
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user