fix: App crash while switching accounts

App is crashing when mapFromSourceRoles is called with 0 m_rolesMappingFromSource length
This commit is contained in:
Alex Jbanca 2024-02-15 23:50:26 +02:00 committed by Alex Jbanca
parent 277175dbf3
commit 4b1b779bee
1 changed files with 3 additions and 0 deletions

View File

@ -685,6 +685,9 @@ QVector<int> ConcatModel::mapFromSourceRoles(
int sourceIndex, const QVector<int>& sourceRoles) const
{
QVector<int> mapped;
if (sourceIndex < 0 || sourceIndex >= m_rolesMappingFromSource.size())
return mapped;
mapped.reserve(sourceRoles.size());
auto& mapping = m_rolesMappingFromSource[sourceIndex];