diff --git a/lib/UserInterface/textinput/Editor.cpp b/lib/UserInterface/textinput/Editor.cpp index 7e4681f7..91ab430a 100644 --- a/lib/UserInterface/textinput/Editor.cpp +++ b/lib/UserInterface/textinput/Editor.cpp @@ -384,6 +384,7 @@ namespace textinput { return kPRSuccess; } case kCmdUndo: + if (fUndoBuf.empty()) return kPRSuccess; Line = fUndoBuf.back().first; fContext->SetCursor(fUndoBuf.back().second); fUndoBuf.pop_back();