From b7e8ffa3ab5fd61971c571c4fff599b57d2aafe0 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Wed, 21 Jul 2010 21:26:08 +0200 Subject: 1) Fix snapping of guides to nodes/paths; 2) replace a g_assert with a return statement (bzr r9638) --- src/sp-item.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/sp-item.cpp') diff --git a/src/sp-item.cpp b/src/sp-item.cpp index 325009fe5..d213ce2d7 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -973,8 +973,15 @@ static void sp_item_private_snappoints(SPItem const *item, std::vector &p, Inkscape::SnapPreferences const *snapprefs) { - g_assert (item != NULL); - g_assert (SP_IS_ITEM(item)); + if (item == NULL) { + g_warning("sp_item_snappoints: cannot snap because no item is being provided"); + return; + } + + if (!SP_IS_ITEM(item)) { + g_warning("sp_item_snappoints: cannot snap because this is not a SP_ITEM"); + return; + } // Get the snappoints of the item SPItemClass const &item_class = *(SPItemClass const *) G_OBJECT_GET_CLASS(item); -- cgit v1.2.3