diff --git a/src/Firewall.cpp b/src/Firewall.cpp index f94012c..6cf0fe0 100644 --- a/src/Firewall.cpp +++ b/src/Firewall.cpp @@ -58,6 +58,8 @@ namespace fw firewall_rule_t *Firewall::update_rule_of_firewall(String *args, const uint8_t key) { firewall_rule_t *rule_ptr = get_rule_from_firewall(key); + if (rule_ptr == NULL) + return rule_ptr; strncpy(rule_ptr->ip, args[IP].c_str(), sizeof(rule_ptr->ip)); rule_ptr->port_from = args[PORT_FROM].toInt(); rule_ptr->port_to = args[PORT_TO].toInt();