Qt: Fix nullpointer access

Due to changes with the frameSelect, this null pointer check
now fails or more on the point is more obvious. It was masked
previous

Change-Id: I11c3f3440e39742bce963d1ef8bdd27076baa700
Reviewed-on: https://code.wireshark.org/review/35177
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
This commit is contained in:
Roland Knall 2019-11-21 12:35:29 +01:00
parent 5199a61e79
commit 59ce14522b
1 changed files with 6 additions and 3 deletions

View File

@ -1160,7 +1160,6 @@ void MainWindow::setMenusForSelectedPacket()
<< main_ui_->actionViewColorizeConversation9 << main_ui_->actionViewColorizeConversation10;
if (capture_file_.capFile()) {
QList<int> rows = selectedRows();
frame_data * current_frame = 0;
if (rows.count() > 0)
@ -1209,8 +1208,12 @@ void MainWindow::setMenusForSelectedPacket()
main_ui_->actionEditNextMark->setEnabled(another_is_marked);
main_ui_->actionEditPreviousMark->setEnabled(another_is_marked);
main_ui_->actionEditPacketComment->setEnabled(frame_selected && wtap_dump_can_write(capture_file_.capFile()->linktypes, WTAP_COMMENT_PER_PACKET));
main_ui_->actionDeleteAllPacketComments->setEnabled((capture_file_.capFile() != NULL) && wtap_dump_can_write(capture_file_.capFile()->linktypes, WTAP_COMMENT_PER_PACKET));
GArray * linkTypes = Q_NULLPTR;
if (capture_file_.capFile() && capture_file_.capFile()->linktypes)
linkTypes = capture_file_.capFile()->linktypes;
main_ui_->actionEditPacketComment->setEnabled(frame_selected && linkTypes && wtap_dump_can_write(capture_file_.capFile()->linktypes, WTAP_COMMENT_PER_PACKET));
main_ui_->actionDeleteAllPacketComments->setEnabled(linkTypes && wtap_dump_can_write(capture_file_.capFile()->linktypes, WTAP_COMMENT_PER_PACKET));
main_ui_->actionEditIgnorePacket->setEnabled(frame_selected || multi_selection);
main_ui_->actionEditIgnoreAllDisplayed->setEnabled(have_filtered);