From 9c0b8ae87db4fc8f471924a14b9420709a607b7d Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Fri, 22 Jul 2011 12:02:36 +0200 Subject: fix crash when guideline is deleted by dragging it off-canvas (bzr r10488) --- src/sp-guide.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/sp-guide.cpp') diff --git a/src/sp-guide.cpp b/src/sp-guide.cpp index 8d9d7b87d..033e1db1f 100644 --- a/src/sp-guide.cpp +++ b/src/sp-guide.cpp @@ -476,6 +476,10 @@ char *sp_guide_description(SPGuide const *guide, const bool verbose) using Geom::Y; SPNamedView *namedview = sp_document_namedview(guide->document, NULL); + if (!namedview) { + // Guide has probably been deleted and no longer has an attached namedview. + return g_strdup_printf(_("Deleted")); + } GString *position_string_x = SP_PX_TO_METRIC_STRING(guide->point_on_line[X], namedview->getDefaultMetric()); GString *position_string_y = SP_PX_TO_METRIC_STRING(guide->point_on_line[Y], -- cgit v1.2.3