linuxmint / warpinator

Share files across the LAN
GNU General Public License v3.0
1.24k stars 83 forks source link

Warpinator SLOWS DOWN NEMO context menu to TWO SECONDS because of a PYTHON ERROR with iterating over a NoneType object when it is not connected to a Network #198

Closed carlosmintfan closed 12 months ago

carlosmintfan commented 1 year ago

Distribution

Mint 21.2 Cinnamon

Package version

1.7.0 (unstable romeo)

Frequency

Always

Bug description

When warpinator is not connected to a Network, opening a nemo context menu on one or multiple files/folders SLOWS DOWN to some seconds because warpinator doesn't get an empty list as remotes in dbus_services.py like when it is connected to a network but doesn't have remotes, but if it isn't even connected to a network there's that error which results in it not returning something to DBUS call or so and then it waits during the timeout period or so. Here's the error when running warpinator --debug.

Traceback (most recent call last):
  File "/usr/libexec/warpinator/dbus_service.py", line 53, in _method_cb
    for remote in remotes:
TypeError: 'NoneType' object is not iterable
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 153, in apport_excepthook
    with os.fdopen(os.open(pr_filename,
FileNotFoundError: [Errno 2] Datei oder Verzeichnis nicht gefunden: '/var/crash/_usr_libexec_warpinator_warpinator-launch.py.1000.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/libexec/warpinator/dbus_service.py", line 53, in _method_cb
    for remote in remotes:
TypeError: 'NoneType' object is not iterable

Steps to reproduce

  1. Make sure you aren't connected to any network - wifi, LAN, nothing.
  2. Open warpinator.
  3. Wait until you get the error message that you aren't connected to a network.
  4. Right-click on a file in nemo (not just on blank space).
  5. See that you have to wait some seconds before the context menu opens.

Expected behavior

The same that happens when warpinator is connected to a network but has no remotes. The context menu should open without delay, but not showing the "Send by warpinator" button.

Additional information

No response