From a1fd1978c780fe19951aee92242c37e7063f6be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20=C3=96nnerby?= Date: Tue, 13 Jan 2009 15:48:35 +0000 Subject: [PATCH] Small fix in query::SortTracksWithData to handle NULL values. --- src/core/Query/SortTracksWithData.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/Query/SortTracksWithData.cpp b/src/core/Query/SortTracksWithData.cpp index ef12e3fec..f49a75438 100644 --- a/src/core/Query/SortTracksWithData.cpp +++ b/src/core/Query/SortTracksWithData.cpp @@ -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);