Small fix in query::SortTracksWithData to handle NULL values.

This commit is contained in:
Daniel Önnerby 2009-01-13 15:48:35 +00:00
parent 94530ec9a4
commit a1fd1978c7

View File

@ -145,7 +145,10 @@ bool Query::SortTracksWithData::ParseQuery(Library::Base *library,db::Connection
while(selectTracks.Step()==db::ReturnCode::Row){
TrackWithSortdata newSortData;
newSortData.track.reset(new LibraryTrack(selectTracks.ColumnInt(0),library->Id()));
newSortData.sortData = selectTracks.ColumnTextUTF(1);
const utfchar* sortDataPtr = selectTracks.ColumnTextUTF(1);
if(sortDataPtr){
newSortData.sortData = sortDataPtr;
}
// Convert the content to lower if futher sorting need to be done
boost::algorithm::to_lower(newSortData.sortData);