Fix piece carrousel context menu crash

This commit is contained in:
Ronan Le Tiec 2020-11-21 14:28:28 +01:00
parent b9e26f0b3f
commit 728b2c83c3

View File

@ -187,6 +187,8 @@ void VPCarrouselPieceList::dragMoveEvent(QDragMoveEvent* e)
void VPCarrouselPieceList::contextMenuEvent(QContextMenuEvent *event)
{
QListWidgetItem* _item = currentItem();
if(_item != nullptr)
{
if(_item->type() == 1001)
{
VPCarrouselPiece *pieceItem = static_cast<VPCarrouselPiece *> (_item);
@ -221,6 +223,7 @@ void VPCarrouselPieceList::contextMenuEvent(QContextMenuEvent *event)
contextMenu.exec(event->globalPos());
}
}
}