summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiam P. White <inkscapebrony@gmail.com>2014-07-24 20:56:54 +0000
committerLiam P. White <inkscapebrony@gmail.com>2014-07-24 20:56:54 +0000
commitb4f5e57056ed7db1974fe21741fcb7c6ff7aa0c2 (patch)
tree2a6a553fccd4c3fddd82bae251793b5418728bfa /src
parentFix typo in dbus api files (diff)
downloadinkscape-b4f5e57056ed7db1974fe21741fcb7c6ff7aa0c2.tar.gz
inkscape-b4f5e57056ed7db1974fe21741fcb7c6ff7aa0c2.zip
Fix crash bug when exporting PNG from CLI
(bzr r13341.5.12)
Diffstat (limited to 'src')
-rw-r--r--src/inkscape.cpp10
1 files changed, 6 insertions, 4 deletions
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<SPDesktop*>::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<SPDesktop*>::iterator iter = _desktops->begin(), e = _desktops->end() ; iter != e ; ++iter) {
+ SPDesktop *desktop = *iter;
+ if (desktop->doc() == doc) {
+ return Inkscape::ActionContext(desktop);
+ }
}
}