MeanEYE / Sunflower

Small and highly customizable twin-panel file manager for Linux with support for plugins.
GNU General Public License v3.0
428 stars 42 forks source link

Context menu won't open in file list when clipboard is empty #456

Closed joshas closed 3 years ago

joshas commented 4 years ago

When clipboard is empty right clicking (or pressing "Menu" key on keyboard) produces following error message and context menu does not open:


Traceback (most recent call last):
  File "/home/user/projects/Sunflower/sunflower/plugin_base/item_list.py", line 552, in _handle_button_press
    self._show_popup_menu(widget)
  File "/home/user/projects/Sunflower/sunflower/plugin_base/item_list.py", line 1224, in _show_popup_menu
    self._prepare_popup_menu()
  File "/home/user/projects/Sunflower/sunflower/plugins/file_list/file_list.py", line 1216, in _prepare_popup_menu
    self._paste_item.set_sensitive(self._parent.is_clipboard_item_list())
  File "/home/user/projects/Sunflower/sunflower/gui/main_window.py", line 2417, in is_clipboard_item_list
    result = data[0] == targets[0] or data[0] in ('copy', 'cut')
IndexError: list index out of range