From c7f46136fcec6c4c640b36b0ec5553d1672e9efc Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Thu, 19 Mar 2015 17:18:24 +0100 Subject: [PATCH] Do not crash. --- src/modules/partition/gui/PartitionSplitterWidget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/partition/gui/PartitionSplitterWidget.cpp b/src/modules/partition/gui/PartitionSplitterWidget.cpp index 162921130..9c112de5e 100644 --- a/src/modules/partition/gui/PartitionSplitterWidget.cpp +++ b/src/modules/partition/gui/PartitionSplitterWidget.cpp @@ -49,6 +49,7 @@ PartitionSplitterWidget::init( const QList& items ) m_itemToResizeNext = nullptr; m_itemToResizePath.clear(); + m_items.clear(); m_items = items; repaint(); foreach ( const PartitionSplitterItem& item, items ) @@ -164,7 +165,8 @@ PartitionSplitterWidget::paintEvent( QPaintEvent* event ) QPainter painter( this ); painter.fillRect( rect(), palette().window() ); painter.setRenderHint( QPainter::Antialiasing ); - drawPartitions( &painter, rect(), m_items ); + if ( m_itemToResize && m_itemToResizeNext ) + drawPartitions( &painter, rect(), m_items ); }