From 9a61d864b24fa8e9a51cbb75dbf82d61643d467e Mon Sep 17 00:00:00 2001 From: Maximilian Albert Date: Fri, 22 Feb 2008 10:18:37 +0000 Subject: Don't crash when the original of an SPUse can't be found. This sort of fixes LP 185734, but maybe further action would be appropriate (e.g., should we remove orphaned items from the xml tree in the first place?). (bzr r4821) --- src/object-snapper.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/object-snapper.cpp') diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp index e320f013f..0308efe2d 100644 --- a/src/object-snapper.cpp +++ b/src/object-snapper.cpp @@ -166,6 +166,7 @@ void Inkscape::ObjectSnapper::_collectNodes(Inkscape::Snapper::PointType const & if (SP_IS_USE(*i)) { root_item = sp_use_root(SP_USE(*i)); } + g_return_if_fail(root_item); //Collect all nodes so we can snap to them if (_snap_to_itemnode) { @@ -271,6 +272,7 @@ void Inkscape::ObjectSnapper::_collectPaths(Inkscape::Snapper::PointType const & if (SP_IS_USE(*i)) { i2doc = sp_use_get_root_transform(SP_USE(*i)); root_item = sp_use_root(SP_USE(*i)); + g_return_if_fail(root_item); } else { i2doc = sp_item_i2doc_affine(*i); root_item = *i; -- cgit v1.2.3