From 50cff32bb7ab2fb2ab618ee5b3f4e31852e5802c Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Sat, 18 Feb 2017 13:10:14 +0100 Subject: Fix bug 1665595 and prevent other LPE the same bug when using ACTIVE_DOCUMENT Fixed bugs: - https://launchpad.net/bugs/1665595 (bzr r15530) --- src/live_effects/lpe-clone-original.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/live_effects/lpe-clone-original.cpp') diff --git a/src/live_effects/lpe-clone-original.cpp b/src/live_effects/lpe-clone-original.cpp index 04db6171e..b1cd6b0e5 100644 --- a/src/live_effects/lpe-clone-original.cpp +++ b/src/live_effects/lpe-clone-original.cpp @@ -64,6 +64,9 @@ void LPECloneOriginal::cloneAttrbutes(SPObject *origin, SPObject *dest, bool live, const char * attributes, const char * style_attributes, bool root) { SPDocument * document = SP_ACTIVE_DOCUMENT; + if (!document) { + return; + } if ( SP_IS_GROUP(origin) && SP_IS_GROUP(dest) && SP_GROUP(origin)->getItemCount() == SP_GROUP(dest)->getItemCount() ) { std::vector< SPObject * > childs = origin->childList(true); size_t index = 0; -- cgit v1.2.3