1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-21 16:29:43 +01:00

Don't crash if there's no model attached to a view when it's resized

This commit is contained in:
Leo Franchi 2011-10-15 19:29:50 -04:00
parent b3bfc2b464
commit 7cc964dfc5
2 changed files with 6 additions and 0 deletions

View File

@ -196,6 +196,9 @@ ArtistView::resizeEvent( QResizeEvent* event )
QTreeView::resizeEvent( event );
m_header->checkState();
if ( !model() )
return;
if ( model()->columnCount( QModelIndex() ) == 1 )
{
m_header->resizeSection( 0, event->size().width() );

View File

@ -233,6 +233,9 @@ TrackView::resizeEvent( QResizeEvent* event )
sortByColumn( sortSection, sortOrder );
}
if ( !model() )
return;
if ( model()->columnCount() == 1 )
{
m_header->resizeSection( 0, event->size().width() );