AttributeError: 'NoneType' object has no attribute 'canonicalFilePath'

Bug #401032 reported by Mitsuhiro Koga
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar Explorer
Fix Released
Undecided
Unassigned

Bug Description

bzr-explorer: revno171
bzr: 1.16.1

To reproduce:
1) Open a branch with bazaar-explorer.
2) Push edit button without selecting any file.

or
1) Open two branch with bazaar-explorer.
2) Select a file in WT.
3) Switch another branch.
4) Push edit button without selecting any file.

Traceback (most recent call last):
  File "/Users/shiena/.bazaar/plugins/explorer/lib/wt_browser.py", line 123, in do_edit_file
    path = fileinfo.canonicalFilePath()
AttributeError: 'NoneType' object has no attribute 'canonicalFilePath'

Revision history for this message
Mitsuhiro Koga (shiena-jp) wrote :

I think that you should invalidate the edit button, when the item has not been selected.
And, after the branch is switched, the selection has been released.

=== modified file lib/wt_browser.py
--- lib/wt_browser.py 2009-07-16 12:31:36 +0000
+++ lib/wt_browser.py 2009-07-18 09:56:41 +0000
@@ -152,9 +152,13 @@
             self.stacked.setCurrentIndex(1)
             index = self.model.index(path)
             self.view.setRootIndex(index)
+ self.view.selectionModel().reset()
         self._root = path
         self._selected_fileinfo = None
+ self._edit_button.setEnabled(False)

Revision history for this message
Mitsuhiro Koga (shiena-jp) wrote :

Sorry, indent shifted. The patch is appended.

Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

Thanks for the patch. Applied in rev 172.

Changed in bzr-explorer:
status: New → Fix Released
Changed in bzr-explorer:
milestone: none → 0.5
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.