summaryrefslogtreecommitdiffstats
path: root/src/sp-item.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mailat-signdiedenrezidotnl>2010-07-21 19:26:08 +0000
committerDiederik van Lierop <mailat-signdiedenrezidotnl>2010-07-21 19:26:08 +0000
commitb7e8ffa3ab5fd61971c571c4fff599b57d2aafe0 (patch)
tree5f4fa7a2fa658f499a81a842b8c77d7e488282ad /src/sp-item.cpp
parentMake OpenMP actually work on systems that use Autoconf. (diff)
downloadinkscape-b7e8ffa3ab5fd61971c571c4fff599b57d2aafe0.tar.gz
inkscape-b7e8ffa3ab5fd61971c571c4fff599b57d2aafe0.zip
1) Fix snapping of guides to nodes/paths; 2) replace a g_assert with a return statement
(bzr r9638)
Diffstat (limited to 'src/sp-item.cpp')
-rw-r--r--src/sp-item.cpp11
1 files changed, 9 insertions, 2 deletions
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<Inkscape:
void sp_item_snappoints(SPItem const *item, std::vector<Inkscape::SnapCandidatePoint> &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);