From f5931c60f7f57a68377c6dec260c26edabae867a Mon Sep 17 00:00:00 2001 From: buliabyak Date: Mon, 9 Mar 2009 00:31:51 +0000 Subject: [PATCH] suppress warnings caused by an orphaned clone, which is legit even if useless --- src/sp-use.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/sp-use.cpp b/src/sp-use.cpp index 990407f95..76930086c 100644 --- a/src/sp-use.cpp +++ b/src/sp-use.cpp @@ -388,10 +388,11 @@ SPItem * 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); } @@ -749,7 +750,8 @@ sp_use_snappoints(SPItem const *item, bool const target, SnapPointsWithType &p, 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) { -- 2.30.2