aboutsummaryrefslogtreecommitdiff
path: root/src/sword.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/sword.cc')
-rw-r--r--src/sword.cc4
1 files changed, 2 insertions, 2 deletions
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<Gtk::TextBuffer> 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<Gtk::TextBuffer> 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;