Fixed crash using undo while dragging a new part.

This commit is contained in:
Leonardo Zide 2020-02-01 10:58:19 -08:00
parent d626048a64
commit 60aca425a0

View file

@ -1976,8 +1976,11 @@ void View::EndDrag(bool Accept)
break;
case lcDragState::PIECE:
ActiveModel->InsertPieceToolClicked(GetPieceInsertPosition(false, gMainWindow->GetCurrentPieceInfo()));
break;
{
PieceInfo* Info = gMainWindow->GetCurrentPieceInfo();
if (Info)
ActiveModel->InsertPieceToolClicked(GetPieceInsertPosition(false, Info));
} break;
case lcDragState::COLOR:
ActiveModel->PaintToolClicked(FindObjectUnderPointer(true, false).Object);