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:
parent
b3bfc2b464
commit
7cc964dfc5
@ -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() );
|
||||
|
@ -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() );
|
||||
|
Loading…
x
Reference in New Issue
Block a user