summaryrefslogtreecommitdiffstats
path: root/src/object-snapper.cpp
diff options
context:
space:
mode:
authorKris De Gussem <kris.degussem@gmail.com>2012-05-04 15:40:04 +0000
committerKris <Kris.De.Gussem@hotmail.com>2012-05-04 15:40:04 +0000
commitecdd31b0c95f8f210038bc3dd5dfc0afb7a68883 (patch)
tree56a4dbdc763833577eebb9571128ac8ee8649117 /src/object-snapper.cpp
parentcpp-style casting (diff)
downloadinkscape-ecdd31b0c95f8f210038bc3dd5dfc0afb7a68883.tar.gz
inkscape-ecdd31b0c95f8f210038bc3dd5dfc0afb7a68883.zip
Adding checks to prevent null pointer dereferences
(bzr r11325)
Diffstat (limited to 'src/object-snapper.cpp')
-rw-r--r--src/object-snapper.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp
index bda856914..e6f6d87db 100644
--- a/src/object-snapper.cpp
+++ b/src/object-snapper.cpp
@@ -111,11 +111,11 @@ void Inkscape::ObjectSnapper::_findCandidates(SPObject* parent,
// The current item is not a clipping path or a mask, but might
// still be the subject of clipping or masking itself ; if so, then
// we should also consider that path or mask for snapping to
- obj = SP_OBJECT(item->clip_ref->getObject());
+ obj = SP_OBJECT(item->clip_ref ? item->clip_ref->getObject() : NULL);
if (obj && _snapmanager->snapprefs.isTargetSnappable(SNAPTARGET_PATH_CLIP)) {
_findCandidates(obj, it, false, bbox_to_snap, true, item->i2doc_affine());
}
- obj = SP_OBJECT(item->mask_ref->getObject());
+ obj = SP_OBJECT(item->mask_ref ? item->mask_ref->getObject() : NULL);
if (obj && _snapmanager->snapprefs.isTargetSnappable(SNAPTARGET_PATH_MASK)) {
_findCandidates(obj, it, false, bbox_to_snap, true, item->i2doc_affine());
}