TypeError when adding a launcher and nothing is selected in the directory view

Bug #1556664 reported by My Karlsson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MenuLibre
Fix Released
Undecided
Unassigned

Bug Description

Summary:

An error is emitted if a launcher is added when no row is selected in the directory tree view.

Steps to reproduce:

1. Deselect any selected entries in the directory tree view.
2. Click on the "+" button and select "Add Launcher" from the drop-drown menu.

Expected result:

Nothing.

Actual result:

The following traceback is emitted.

Traceback (most recent call last):
  File "/home/mk/Downloads/menulibre/menulibre/MenulibreApplication.py", line 1633, in on_add_launcher_cb
    self.add_launcher()
  File "/home/mk/Downloads/menulibre/menulibre/MenulibreApplication.py", line 1422, in add_launcher
    if row_data[2] == MenuItemTypes.DIRECTORY:
TypeError: 'NoneType' object is not subscriptable

Workaround:

I have attached a patch which makes the add_launcher routine exit early if no row is selected in the directory tree view.

Revision history for this message
My Karlsson (mykarlsson-deactivatedaccount) wrote :
summary: - TypeError when adding a launcher a nothing is selected in the directory
- view
+ TypeError when adding a launcher and nothing is selected in the
+ directory view
Revision history for this message
Sean Davis (bluesabre) wrote :

Thanks for the patch! Confirmed and applied at the below commit.

http://bazaar.launchpad.net/~menulibre-dev/menulibre/master/revision/461

Changed in menulibre:
status: New → Fix Committed
Sean Davis (bluesabre)
Changed in menulibre:
milestone: none → 2.1.4
Revision history for this message
My Karlsson (mykarlsson-deactivatedaccount) wrote :

Thanks!

Sean Davis (bluesabre)
Changed in menulibre:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.