From 7d460552d756e82090d87d0cfc8c7128b20db4ce Mon Sep 17 00:00:00 2001 From: Leonardo De Oliveira Carvalho Date: Tue, 19 Dec 2023 11:45:15 -0300 Subject: [PATCH 1/2] Make sure undo is not empty before accessing the last element --- src/document-undo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/document-undo.cpp b/src/document-undo.cpp index cdde7d96ad..44c636df27 100644 --- a/src/document-undo.cpp +++ b/src/document-undo.cpp @@ -205,7 +205,7 @@ void Inkscape::DocumentUndo::cancel(SPDocument *doc) g_assert (doc->sensitive); done(doc, "undozone", ""); // ensure tere is something to undo (extension crach can do nothing) - if (doc->undo.back()->description == "undozone") { + if (!doc->undo.empty() && doc->undo.back()->description == "undozone") { undo(doc); clearRedo(doc); } -- GitLab From 2e3c254b98139ab931db21ef967d0b88007c3dc3 Mon Sep 17 00:00:00 2001 From: Leonardo De Oliveira Carvalho Date: Tue, 19 Dec 2023 15:58:14 -0300 Subject: [PATCH 2/2] Using .front() and .back() to access first and last nodes in open path --- src/live_effects/lpe-fillet-chamfer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/live_effects/lpe-fillet-chamfer.cpp b/src/live_effects/lpe-fillet-chamfer.cpp index 60b7f0e3ea..b23faba33f 100644 --- a/src/live_effects/lpe-fillet-chamfer.cpp +++ b/src/live_effects/lpe-fillet-chamfer.cpp @@ -338,8 +338,8 @@ void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem) } } if (pathv.size() > i && !pathv[i].closed()) { - nodesatellites[i][0].amount = 0; - nodesatellites[i][count_path_nodes(pathv[i]) - 1].amount = 0; + nodesatellites[i].front().amount = 0; + nodesatellites[i].back().amount = 0; } } if (!_pathvector_nodesatellites) { -- GitLab