summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1847cc8)
raw | patch | inline | side by side (parent: 1847cc8)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Mon, 9 Mar 2009 00:31:51 +0000 (00:31 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Mon, 9 Mar 2009 00:31:51 +0000 (00:31 +0000) |
src/sp-use.cpp | patch | blob | history |
diff --git a/src/sp-use.cpp b/src/sp-use.cpp
index 990407f95deb85b7004b4e8dcaf142a58c107e4e..76930086cc64dae64d4ccb1a492a43a9a368ec44 100644 (file)
--- a/src/sp-use.cpp
+++ b/src/sp-use.cpp
sp_use_root(SPUse *use)
{
SPObject *orig = use->child;
- while (SP_IS_USE(orig)) {
+ while (orig && SP_IS_USE(orig)) {
orig = SP_USE(orig)->child;
}
- g_return_val_if_fail(SP_IS_ITEM(orig), NULL);
+ if (!orig || !SP_IS_ITEM(orig))
+ return NULL;
return SP_ITEM(orig);
}
SPUse *use = SP_USE(item);
SPItem *root = sp_use_root(use);
- g_return_if_fail(root);
+ if (!root)
+ return;
SPItemClass const &item_class = *(SPItemClass const *) G_OBJECT_GET_CLASS(root);
if (item_class.snappoints) {