summaryrefslogtreecommitdiffstats
path: root/src/snap.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2009-04-07 18:42:48 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2009-04-07 18:42:48 +0000
commit6d53c39a1c1212f65fb912a10ac78b07e60382ad (patch)
tree18a3ea4e4345b15126b1d6d5b76698c86a3aff83 /src/snap.cpp
parentoops, fix a bug in that last commit (revealed by eps import; I don't think th... (diff)
downloadinkscape-6d53c39a1c1212f65fb912a10ac78b07e60382ad.tar.gz
inkscape-6d53c39a1c1212f65fb912a10ac78b07e60382ad.zip
Fix crash: desktop does not always have an event_context attached to it!
(bzr r7660)
Diffstat (limited to 'src/snap.cpp')
-rw-r--r--src/snap.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/snap.cpp b/src/snap.cpp
index 19455ba73..392e1c075 100644
--- a/src/snap.cpp
+++ b/src/snap.cpp
@@ -161,7 +161,7 @@ Inkscape::SnappedPoint SnapManager::freeSnap(Inkscape::SnapPreferences::PointTyp
bool first_point,
Geom::OptRect const &bbox_to_snap) const
{
- if (_desktop->event_context->_snap_window_open == false) {
+ if (_desktop->event_context && _desktop->event_context->_snap_window_open == false) {
g_warning("context_snap_window_open has not been set to true by the current context. Please report this!");
// When the context goes into dragging-mode, then Inkscape should call this: sp_event_context_snap_window_open(event_context);
}
@@ -296,7 +296,7 @@ Inkscape::SnappedPoint SnapManager::constrainedSnap(Inkscape::SnapPreferences::P
bool first_point,
Geom::OptRect const &bbox_to_snap) const
{
- if (_desktop->event_context->_snap_window_open == false) {
+ if (_desktop->event_context && _desktop->event_context->_snap_window_open == false) {
g_warning("context_snap_window_open has not been set to true by the current context. Please report this!");
// When the context goes into dragging-mode, then Inkscape should call this: sp_event_context_snap_window_open(event_context);
}
@@ -334,7 +334,7 @@ void SnapManager::guideSnap(Geom::Point &p, Geom::Point const &guide_normal) con
{
// This method is used to snap a guide to nodes or to other guides, while dragging the guide around. Will not snap to grids!
- if (_desktop->event_context->_snap_window_open == false) {
+ if (_desktop->event_context && _desktop->event_context->_snap_window_open == false) {
g_warning("context_snap_window_open has not been set to true by the current context. Please report this!");
// When the context goes into dragging-mode, then Inkscape should call this: sp_event_context_snap_window_open(event_context);
}