fix a crash in the endpoint dialogue

compile Wireshark with GeoIP enabled
load a USB capture
open Statistics / Endpoints
   the tree is empty, USB is not amongst the selected Enpoint Types
select USB in the Endpoint Types list
-> crash

to fix this, add a NULL check for cur_tree to EndpointDialog::tabChanged()

Change-Id: I43d963ae5cd451120ac354e89e37ccbbbc2c5910
Reviewed-on: https://code.wireshark.org/review/5192
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
This commit is contained in:
Martin Kaiser 2014-11-08 12:30:39 +01:00
parent 47909d32fc
commit 58447619b6
1 changed files with 1 additions and 1 deletions

View File

@ -176,7 +176,7 @@ bool EndpointDialog::addTrafficTable(register_ct_t *table)
void EndpointDialog::tabChanged()
{
EndpointTreeWidget *cur_tree = qobject_cast<EndpointTreeWidget *>(trafficTableTabWidget()->currentWidget());
map_bt_->setEnabled(cur_tree->hasGeoIPData());
map_bt_->setEnabled(cur_tree && cur_tree->hasGeoIPData());
}
void EndpointDialog::createMap()