From 5ed764178a7ff43d30ced21ffa8d5f36c64074c8 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 29 Oct 2016 03:13:59 +0200 Subject: Fix crash with empty patch-names. An empty text will not produce a bounding box. --- libs/canvas/flag.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/canvas/flag.cc b/libs/canvas/flag.cc index 2d0bdb2830..d0ce5af2b1 100644 --- a/libs/canvas/flag.cc +++ b/libs/canvas/flag.cc @@ -72,7 +72,11 @@ Flag::set_font_description (Pango::FontDescription font_description) void Flag::set_text (string const & text) { - _text->set (text); + if (text.empty ()) { + _text->set (" "); + } else { + _text->set (text); + } boost::optional bbox = _text->bounding_box (); assert (bbox); -- cgit v1.2.3