diff --git a/clientgui/MainDocument.cpp b/clientgui/MainDocument.cpp index 66b23a4d6b..9e96736da1 100644 --- a/clientgui/MainDocument.cpp +++ b/clientgui/MainDocument.cpp @@ -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); }