prevent accessing empty vector

Fixes https://github.com/root-project/root/issues/10180
This commit is contained in:
ferdymercury 2022-03-21 11:32:51 +01:00 committed by Axel Naumann
parent a575990cfc
commit 97166bc3b2

View File

@ -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();