Skip to content

Commit

Permalink
Refs #9090. Add a simple null check to prevent segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
arturbekasov committed Mar 17, 2014
1 parent 9f6600b commit 4a22d75
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Code/Mantid/MantidPlot/src/Folder.cpp
Expand Up @@ -324,12 +324,20 @@ viewportToContents( viewport()->mapFromGlobal( QCursor::pos() ) );

QPixmap pix;
if (item->rtti() == FolderListItem::RTTI)
{
pix = getQPixmap("folder_closed_xpm");
else
pix = *item->pixmap (0);
}
else if ( const QPixmap* p = item->pixmap(0) )
{
pix = *p;
}

Q3IconDrag *drag = new Q3IconDrag(viewport());
drag->setPixmap(pix, QPoint(pix.width()/2, pix.height()/2 ) );

if ( ! pix.isNull() )
{
drag->setPixmap(pix, QPoint(pix.width()/2, pix.height()/2 ) );
}

QList<Q3ListViewItem *> lst;
for (item = firstChild(); item; item = item->itemBelow())
Expand Down

0 comments on commit 4a22d75

Please sign in to comment.