aboutsummaryrefslogtreecommitdiff
path: root/src/MessageBoard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/MessageBoard.cpp')
-rw-r--r--src/MessageBoard.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/MessageBoard.cpp b/src/MessageBoard.cpp
index c75573a..0152cb5 100644
--- a/src/MessageBoard.cpp
+++ b/src/MessageBoard.cpp
@@ -326,7 +326,7 @@ namespace dchat
if(onlineLocalUser && event.type == sf::Event::MouseButtonPressed && event.mouseButton.button == sf::Mouse::Button::Right)
openContextMenu = true;
- if(visibleMessageStartIndex != -1)
+ if(visibleMessageStartIndex != -1 && visibleMessageStartIndex < messages.size() && visibleMessageEndIndex < messages.size())
{
//printf("visibleMessageStartIndex: %u, visibleMessageEndIndex: %u\n", visibleMessageStartIndex, visibleMessageEndIndex);
for(usize i = visibleMessageStartIndex; i <= visibleMessageEndIndex; ++i)