diff --git a/src/widgets/helper/channelview.cpp b/src/widgets/helper/channelview.cpp index 698769116..d3a7b6005 100644 --- a/src/widgets/helper/channelview.cpp +++ b/src/widgets/helper/channelview.cpp @@ -435,7 +435,7 @@ void ChannelView::setChannel(ChannelPtr newChannel) // on message replaced this->channelConnections_.push_back( newChannel->messageReplaced.connect([this](size_t index, MessagePtr replacement) { - if (this->messages.getSnapshot().getLength() >= index || index < 0) { + if (index >= this->messages.getSnapshot().getLength() || index < 0) { return; }