From cd9b7f2f11f56160794c2cf8d223f4b2d0341b86 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Fri, 5 Feb 2010 18:16:05 +0100 Subject: [PATCH] [#86 state:fixed] Fixed a crash in GetOutlineViewValues. --- core/app_cocoa.py | 2 +- core/tests/app_cocoa_test.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/app_cocoa.py b/core/app_cocoa.py index 97580c20..1beb3a1e 100644 --- a/core/app_cocoa.py +++ b/core/app_cocoa.py @@ -257,7 +257,7 @@ class DupeGuru(app.DupeGuru): if tag in (0,2): #Normal results / Power Marker if tag == 0: g, d = self.GetObjects(node_path) - if d is None: + if (d is None) and (g is not None): d = g.ref else: d = self.results.dupes[node_path[0]] diff --git a/core/tests/app_cocoa_test.py b/core/tests/app_cocoa_test.py index 45457818..6e0af5b8 100644 --- a/core/tests/app_cocoa_test.py +++ b/core/tests/app_cocoa_test.py @@ -303,7 +303,10 @@ class TCDupeGuru(TestCase): # Out of range requests don't crash and return an empty value app = self.app # [0, 2] is out of range + # Directories eq_(app.GetOutlineViewValues(1, [0, 2]), []) # no crash + # Normal results + app.GetOutlineViewValues(0, [42, 0]) # no crash class TCDupeGuru_renameSelected(TestCase):