From b4f5e57056ed7db1974fe21741fcb7c6ff7aa0c2 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Thu, 24 Jul 2014 16:56:54 -0400 Subject: Fix crash bug when exporting PNG from CLI (bzr r13341.5.12) --- src/inkscape.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/inkscape.cpp') diff --git a/src/inkscape.cpp b/src/inkscape.cpp index cca6918e2..94c3722cb 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -1165,10 +1165,12 @@ Inkscape::ActionContext Application::action_context_for_document(SPDocument *doc) { // If there are desktops, check them first to see if the document is bound to one of them - for (std::vector::iterator iter = _desktops->begin(), e = _desktops->end() ; iter != e ; ++iter) { - SPDesktop *desktop = *iter; - if (desktop->doc() == doc) { - return Inkscape::ActionContext(desktop); + if (_desktops != NULL) { + for (std::vector::iterator iter = _desktops->begin(), e = _desktops->end() ; iter != e ; ++iter) { + SPDesktop *desktop = *iter; + if (desktop->doc() == doc) { + return Inkscape::ActionContext(desktop); + } } } -- cgit v1.2.3