Skip to content
Permalink
Browse files

Fix insert rows when there are no rows

This condition was hitting an assert in Qt core.
  • Loading branch information
elpaso committed Dec 9, 2017
1 parent b6dd62f commit e4cf0655bd9c93c47bc8b18660b7e748feb61d93
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/gui/symbology/qgscategorizedsymbolrendererwidget.cpp
@@ -64,9 +64,12 @@ void QgsCategorizedSymbolRendererModel::setRenderer( QgsCategorizedSymbolRendere
}
if ( renderer )
{
beginInsertRows( QModelIndex(), 0, renderer->categories().size() - 1 );
mRenderer = renderer;
endInsertRows();
if ( renderer->categories().size() > 0 )
{
beginInsertRows( QModelIndex(), 0, renderer->categories().size() - 1 );
endInsertRows();
}
}
}

0 comments on commit e4cf065

Please sign in to comment.
You can’t perform that action at this time.