From ff7307324ce69f3d55aa935db5aa0f1802785115 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 24 Feb 2022 13:05:40 -0500 Subject: Fixed issue when compiling with -D_GLIBCXX_ASSERTIONS --- src/sword.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/sword.cc b/src/sword.cc index a693085..936100a 100644 --- a/src/sword.cc +++ b/src/sword.cc @@ -97,7 +97,7 @@ void Sword::fillBuffer(string ref, Glib::RefPtr buf) { } else if (modifier == "title") { tags.push_back(titleScale); // Ensure newline - if(tex.text.back() != '\n') { + if(!tex.text.empty() and tex.text.back() != '\n') { tex.text.push_back('\n'); } } else if (modifier == "preverse") { @@ -135,7 +135,7 @@ void Sword::fillBuffer(string ref, Glib::RefPtr buf) { } else { iter = buf->insert_with_tags(iter, tex.text, tags); } - if(tex.text.back() == '\n') { + if(!tex.text.empty() and tex.text.back() == '\n') { isNewline = true; } else { isNewline = false; -- cgit v1.2.3