From 118a1eb7877bc99fa881da4b410afe2b6c8fb546 Mon Sep 17 00:00:00 2001 From: Stanislav Mykhailenko Date: Fri, 6 Sep 2024 21:52:09 +0300 Subject: [PATCH] Fix a crash when deselecting a packet --- packetanalyzer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packetanalyzer.cpp b/packetanalyzer.cpp index 8282648..3edd592 100644 --- a/packetanalyzer.cpp +++ b/packetanalyzer.cpp @@ -81,6 +81,8 @@ void PacketAnalyzer::refresh() void PacketAnalyzer::packetSelected() { + if (ui->t_packets->selectedItems().length() == 0) + return; int packetId = ui->t_packets->selectedItems()[0]->text().toInt(); pcpp::RawPacket* packet = m_packets.at(packetId-1); ui->e_selected->setText(PacketManager::getPacketData(packet));