Skip to content

Commit

Permalink
Fix insert rows when there are no rows
Browse files Browse the repository at this point in the history
This condition was hitting an assert in Qt core.
  • Loading branch information
elpaso committed Dec 9, 2017
1 parent b6dd62f commit e4cf065
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/gui/symbology/qgscategorizedsymbolrendererwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}

Expand Down

0 comments on commit e4cf065

Please sign in to comment.