Fix a crash when deselecting a packet
This commit is contained in:
parent
8ea5985e70
commit
118a1eb787
1 changed files with 2 additions and 0 deletions
|
@ -81,6 +81,8 @@ void PacketAnalyzer::refresh()
|
||||||
|
|
||||||
void PacketAnalyzer::packetSelected()
|
void PacketAnalyzer::packetSelected()
|
||||||
{
|
{
|
||||||
|
if (ui->t_packets->selectedItems().length() == 0)
|
||||||
|
return;
|
||||||
int packetId = ui->t_packets->selectedItems()[0]->text().toInt();
|
int packetId = ui->t_packets->selectedItems()[0]->text().toInt();
|
||||||
pcpp::RawPacket* packet = m_packets.at(packetId-1);
|
pcpp::RawPacket* packet = m_packets.at(packetId-1);
|
||||||
ui->e_selected->setText(PacketManager::getPacketData(packet));
|
ui->e_selected->setText(PacketManager::getPacketData(packet));
|
||||||
|
|
Reference in a new issue