Skip to content

Commit

Permalink
Fix invalid warning for deleted tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
uklotzde committed Jul 6, 2019
1 parent 1bc09e8 commit 726a216
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/library/dao/trackdao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 726a216

Please sign in to comment.