diff --git a/Machines/Utility/Typer.cpp b/Machines/Utility/Typer.cpp index 1e290bef5..45efe35e7 100644 --- a/Machines/Utility/Typer.cpp +++ b/Machines/Utility/Typer.cpp @@ -59,7 +59,7 @@ void Typer::append(const std::string &string) { // If the final character in the string is not Typer::EndString // then this machine doesn't need Begin and End, so don't worry about it. ssize_t insertion_position = ssize_t(string_.size()); - if(string_.back() == Typer::EndString) --insertion_position; + if(!string_.empty() && string_.back() == Typer::EndString) --insertion_position; string_.reserve(string_.size() + string.size()); for(const char c : string) {