From 92c6b7a632cb6f380802114abcb4739fd0029261 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 4 May 2014 20:36:44 +0300 Subject: [PATCH] Avoid crash in SlopeTool if nothing is selected --- source/designer/slopetool.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/designer/slopetool.cpp b/source/designer/slopetool.cpp index d4a6ffb..ef96e55 100644 --- a/source/designer/slopetool.cpp +++ b/source/designer/slopetool.cpp @@ -9,6 +9,13 @@ SlopeTool::SlopeTool(Designer &d, Input::Keyboard &k, Input::Mouse &m, const set Tool(d, k, m), total_length(0) { + if(objects.empty()) + { + set_status("Nothing selected"); + set_done(false); + return; + } + for(set::const_iterator i=objects.begin(); i!=objects.end(); ++i) if(!dynamic_cast(*i) || (*i)->get_n_link_slots()!=2) { -- 2.45.2