filter-utils: fix indexing nil value

Check target is not nil, which sometimes occurs, before trying to access
its .id property.

Fixes lua errors in logs.
This commit is contained in:
Pauli Virtanen 2024-01-30 18:06:41 +02:00 committed by George Kiagiadakis
parent c6e3dbf887
commit 6d9205cfe0

View file

@ -470,7 +470,7 @@ function module.get_filter_from_target (direction, si_target)
if v.direction == direction and
not v.disabled and
v.smart and
((v.target ~= nil and v.target.id == target.id) or
((v.target ~= nil and target ~= nil and v.target.id == target.id) or
(target == nil and v.target == nil)) then
return v.main_si
end