summaryrefslogtreecommitdiffstats
path: root/src/selection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/selection.cpp')
-rw-r--r--src/selection.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/selection.cpp b/src/selection.cpp
index f728f3381..7979b5d61 100644
--- a/src/selection.cpp
+++ b/src/selection.cpp
@@ -178,6 +178,7 @@ void Selection::_add(SPObject *obj) {
// (to prevent double-selection)
_removeObjectDescendants(obj);
_removeObjectAncestors(obj);
+ g_return_if_fail(SP_IS_OBJECT(obj));
_objs.push_front(obj);
_objs_set.insert(obj);
@@ -483,7 +484,7 @@ std::vector<Inkscape::SnapCandidatePoint> Selection::getSnapPoints(SnapPreferenc
void Selection::_removeObjectDescendants(SPObject *obj) {
std::vector<SPObject*> toremove;
for ( std::list<SPObject*>::const_iterator iter=_objs.begin();iter!=_objs.end();iter++ ) {
- SPObject *sel_obj= *iter;
+ SPObject *sel_obj= dynamic_cast<SPObject*>(*iter);
SPObject *parent = sel_obj->parent;
while (parent) {
if ( parent == obj ) {