diff --git a/src/object/sp-shape.cpp b/src/object/sp-shape.cpp index e80a21895d8c7c868088d9134fd7639544b36b37..802f167a0d06f87350f7f2eaa9b1bae9a4546b05 100644 --- a/src/object/sp-shape.cpp +++ b/src/object/sp-shape.cpp @@ -1135,7 +1135,7 @@ void SPShape::_setCurve(std::unique_ptr &&new_curve, bool update_displa { _curve = std::move(new_curve); - if (update_display) { + if (update_display && document) { requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } } diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index df8dabc7605cf86cea0bff12c3a4138efc8ab4a1..570d62a8b90f29319df2c198fc338e01939e9af4 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -189,21 +189,26 @@ void PathManipulator::writeXML() _updateOutline(); _setGeometry(); + if (!_path) { + return; + } - if (_path) { - _observer->block(); - if (!empty()) { - _path->updateRepr(); - _getXMLNode()->setAttribute(_nodetypesKey(), _createTypeString()); - } - else { - // this manipulator will have to be destroyed right after this call - _getXMLNode()->removeObserver(*_observer); - _path->deleteObject(true, true); - _path = nullptr; - } - _observer->unblock(); + XML::Node *node = _getXMLNode(); + if (!node) { + return; + } + + _observer->block(); + if (!empty()) { + _path->updateRepr(); + node->setAttribute(_nodetypesKey(), _createTypeString()); + } else { + // this manipulator will have to be destroyed right after this call + node->removeObserver(*_observer); + _path->deleteObject(true, true); + _path = nullptr; } + _observer->unblock(); } /** Remove all nodes from the path. */