From 4f797dec1d4a48a21509ae83562f5521467bc6ac Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Wed, 8 Jan 2014 15:57:01 -0500 Subject: Change my mind on the solution to the bug, protect all selection additions. Fixed bugs: - https://launchpad.net/bugs/168695 (bzr r12894) --- src/selection.cpp | 1 + src/ui/tools/select-tool.cpp | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/selection.cpp b/src/selection.cpp index 7c696daf0..17b7253f2 100644 --- a/src/selection.cpp +++ b/src/selection.cpp @@ -154,6 +154,7 @@ bool Selection::includes(SPObject *obj) const { void Selection::add(SPObject *obj, bool persist_selection_context/* = false */) { g_return_if_fail(obj != NULL); g_return_if_fail(SP_IS_OBJECT(obj)); + g_return_if_fail(obj->document != NULL); if (includes(obj)) { return; diff --git a/src/ui/tools/select-tool.cpp b/src/ui/tools/select-tool.cpp index 94f700ebb..498882417 100644 --- a/src/ui/tools/select-tool.cpp +++ b/src/ui/tools/select-tool.cpp @@ -692,8 +692,7 @@ bool SelectTool::root_handler(GdkEvent* event) { } } else { // simple or shift click, no previous selection _seltrans->resetState(); - if(this->item && this->item->document) - selection->set(this->item); + selection->set(this->item); } } -- cgit v1.2.3