diff options
author | Uwe Klotz <uklotz@mixxx.org> | 2019-07-07 00:26:39 +0200 |
---|---|---|
committer | Uwe Klotz <uklotz@mixxx.org> | 2019-07-07 00:27:32 +0200 |
commit | 726a21663b2f76a5034f3ce99f26fae31b113e7e (patch) | |
tree | 5dc1c38c32967ffbef64c5841fdde73e3c6acffd /src | |
parent | 1bc09e8c4deb6f90285d3be3f9ff2fed3320689e (diff) |
Fix invalid warning for deleted tracks
Diffstat (limited to 'src')
-rw-r--r-- | src/library/dao/trackdao.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/library/dao/trackdao.cpp b/src/library/dao/trackdao.cpp index 04cd70d91f..282b05a86f 100644 --- a/src/library/dao/trackdao.cpp +++ b/src/library/dao/trackdao.cpp @@ -1244,11 +1244,15 @@ TrackPointer TrackDAO::getTrackFromDB(TrackId trackId) const { "INNER JOIN track_locations ON library.location = track_locations.id " "WHERE library.id = %2").arg(columnsStr, trackId.toString())); - if (!query.exec() || !query.next()) { + if (!query.exec()) { LOG_FAILED_QUERY(query) << QString("getTrack(%1)").arg(trackId.toString()); return TrackPointer(); } + if (!query.next()) { + qDebug() << "Track with id =" << trackId << "not found"; + return TrackPointer(); + } QSqlRecord queryRecord = query.record(); int recordCount = queryRecord.count(); |