Skip to content
Snippets Groups Projects
Commit a1bb320d authored by Pierre Lamot's avatar Pierre Lamot Committed by Jean-Baptiste Kempf
Browse files

qt: don't assert in MLListCache::find when cache is empty

cache may have been invalidated before calling this function
parent 4e4fe025
No related branches found
No related tags found
1 merge request!1023qt: run all medialibrary operations in a thread
......@@ -29,7 +29,9 @@ const MLListCache::ItemType* MLListCache::get(size_t index) const
const MLListCache::ItemType* MLListCache::find(const std::function<bool (const MLListCache::ItemType&)> &&f, int *index) const
{
assert(m_total_count >= 0);
if (m_total_count <= 0)
return nullptr;
for (auto iter = std::begin(m_list); iter != std::end(m_list); ++iter)
{
if (f(*iter))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment