From 4bee400f3d7b314c3930b450e6715dfe48a33412 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Thu, 1 Jul 2010 23:21:58 +0200 Subject: fix Launchpad bug 593023: crash in constrained snap due to not calling setup() before snapping Fixed bugs: - https://launchpad.net/bugs/593023 (bzr r9550) --- src/object-snapper.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/object-snapper.cpp') diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp index bced0ac44..983a6fede 100644 --- a/src/object-snapper.cpp +++ b/src/object-snapper.cpp @@ -91,6 +91,12 @@ void Inkscape::ObjectSnapper::_findCandidates(SPObject* parent, return; } + if (_snapmanager->getDesktop() == NULL) { + g_warning("desktop == NULL, so we cannot snap; please inform the developpers of this bug"); + // Apparently the etup() method from the SnapManager class hasn't been called before trying to snap. + } + + if (first_point) { _candidates->clear(); } @@ -99,7 +105,6 @@ void Inkscape::ObjectSnapper::_findCandidates(SPObject* parent, bbox_to_snap_incl.expandBy(getSnapperTolerance()); // see? for (SPObject* o = sp_object_first_child(parent); o != NULL; o = SP_OBJECT_NEXT(o)) { - g_assert(_snapmanager->getDesktop() != NULL); if (SP_IS_ITEM(o) && !(_snapmanager->getDesktop()->itemIsHidden(SP_ITEM(o)) && !clip_or_mask)) { // Snapping to items in a locked layer is allowed // Don't snap to hidden objects, unless they're a clipped path or a mask -- cgit v1.2.3