forked from osmocom/wireshark
Handle setModule(NULL) more safely.
If module_name is null, we can't do much of anything - we don't have a protocol ID, so we don't have a protocol. Change-Id: I42c2fa4b47e39d7ac122c60be91b5d408bf30a1d Reviewed-on: https://code.wireshark.org/review/9569 Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
parent
e312d41883
commit
131e0ab7ea
|
@ -184,12 +184,9 @@ void ProtocolPreferencesMenu::setModule(const char *module_name)
|
|||
module_name_.clear();
|
||||
module_ = NULL;
|
||||
|
||||
if (module_name) {
|
||||
proto_id = proto_get_id_by_filter_name(module_name);
|
||||
protocol = find_protocol_by_id(proto_id);
|
||||
}
|
||||
|
||||
if (proto_id < 0 || !protocol) {
|
||||
if (!module_name ||
|
||||
(proto_id = proto_get_id_by_filter_name(module_name)) < 0 ||
|
||||
!(protocol = find_protocol_by_id(proto_id))) {
|
||||
action = addAction(tr("No protocol preferences available"));
|
||||
action->setDisabled(true);
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue