Comment 11 for bug 488035

Revision history for this message
Andreas Becker (abecker) wrote :

Inkscape::XML::EventChgAttr::_undoOne in xml/event.cpp:166 is called for undoing. The crash occurs in the 4th call to this function after the user triggered the undo.
In the (crashing) call
   observer.notifyAttributeChanged(*this->repr, this->key, this->newval, this->oldval);
there are key = "d" (stored as a quark), newval = "" and oldval = NULL.
Inkscape crashes only in the node editor mode (F2), because the observer is set to another one and only then, _externalChange in ui/tool/path-manipulator is called. Because of d = "", there are no curves the path and _getGeometry sets _spcurve to NULL.
Possible solutions:
* do not use the NodeObserver if the nodes have not been changed by the user
* check for d == ""
* check for _spcurve == NULL
* avoid the calligraphy tool to store the event that causes the crash (do not set d = "")

If d = "" is seen as an invalid path, we should consider the last option and also forbid, that d = "" can be set in the XML editor.