Skip to content

Commit

Permalink
objects: fix ip address retrieval
Browse files Browse the repository at this point in the history
Make sure that if the object is invalide, the
function returns an empty IP list.

This fixes an issue with creation of port forward rules
not using objects.
  • Loading branch information
gsanchietti committed Jun 27, 2024
1 parent 4f4f12e commit 9662129
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/nethsec/objects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ def get_object_ips(uci, database_id):
a list of unique IP addresses from the object
"""
ips = []
if not database_id:
return ips

obj = get_object(uci, database_id)
database, id = database_id.split('/')
Expand Down

0 comments on commit 9662129

Please sign in to comment.