jokob-sk / NetAlertX

🖧🔍 WIFI / LAN intruder detector. Scans for devices connected to your network and alerts you if new and unknown devices are found.
GNU General Public License v3.0
3.15k stars 186 forks source link

[core] isEmpty is not handling (unknown) #899

Open jokob-sk opened 2 days ago

jokob-sk commented 2 days ago
          Also I want to point out a minor difficulty I had during development. I tried using the function `handleEmpty`  to handle the empty columns that this plugin doesn't manage (e.g. hostnames) expecting it to be the correct way of doing so.

That function set the empty values in the database to the string "null" while the system expects unknown values to be the string "(unknown)", and because of that plugins like AVAHISCAN did not count the hostnames as unknown and didn't even try to resolve their name.

I haven't changed the function to return "(unknown)" in case something else depends on the "null" value, but I thing it should, because right now it's quite misleading. Or if there really is an use for the current handleEmpty, than a function handleUnknown would be useful.

Originally posted by @KayJay7 in https://github.com/jokob-sk/NetAlertX/issues/896#issuecomment-2501569390