prevent segfault if strokesgroup is null

preferencesAboutTextFull
Clément Fauconnier 4 years ago
parent 793dec5757
commit 36a9cdaccd
  1. 7
      src/domain/UBGraphicsScene.cpp

@ -1050,8 +1050,11 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
intersectedPolygonItem->copyItemParameters(polygonItem); intersectedPolygonItem->copyItemParameters(polygonItem);
polygonItem->setNominalLine(false); polygonItem->setNominalLine(false);
polygonItem->setStroke(intersectedPolygonItem->stroke()); polygonItem->setStroke(intersectedPolygonItem->stroke());
polygonItem->setStrokesGroup(intersectedPolygonItem->strokesGroup()); if (intersectedPolygonItem->strokesGroup())
intersectedPolygonItem->strokesGroup()->addToGroup(polygonItem); {
polygonItem->setStrokesGroup(intersectedPolygonItem->strokesGroup());
intersectedPolygonItem->strokesGroup()->addToGroup(polygonItem);
}
mAddedItems << polygonItem; mAddedItems << polygonItem;
} }
} }

Loading…
Cancel
Save