SCXML editor: fix crash on pressing copy/cut

QtCreator used to crash when copy or cut button were pressed without
having selected an item.

Task-number: QTCREATORBUG-17637
Change-Id: Iceaea7a9f826ed16c4caee9fc28b4c14eb304c62
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Marco Benelli
2017-01-26 11:28:22 +01:00
parent eefb832c82
commit f00e629227

View File

@@ -216,6 +216,9 @@ void GraphicsScene::removeSelectedItems()
void GraphicsScene::copy() void GraphicsScene::copy()
{ {
if (!m_document->currentTag())
return;
QPointF minPos; QPointF minPos;
QVector<ScxmlTag*> tags; QVector<ScxmlTag*> tags;
if (m_document->currentTag()->tagType() == Scxml) { if (m_document->currentTag()->tagType() == Scxml) {