Merge pull request #1987 from AenBleidd/manager_fix_crt_assert

Manager: get rid of out_of_range exception and handle such situation …
This commit is contained in:
David Anderson 2017-07-20 23:59:27 -07:00 committed by GitHub
commit adf2b1256f
1 changed files with 3 additions and 10 deletions

View File

@ -2109,17 +2109,10 @@ done:
MESSAGE* CMainDocument::message(unsigned int i) {
MESSAGE* pMessage = NULL;
if (messages.messages.empty() || messages.messages.size() <= i)
return NULL;
try {
if (!messages.messages.empty())
pMessage = messages.messages.at(i);
}
catch (std::out_of_range e) {
pMessage = NULL;
}
return pMessage;
return messages.messages.at(i);
}