Do

Merge lp:~jassmith/do/thirdsearchcontrollerfix into lp:do

Proposed by Jason Smith
Status: Merged
Approved by: Jason Smith
Approved revision: 1255
Merged at revision: not available
Proposed branch: lp:~jassmith/do/thirdsearchcontrollerfix
Merge into: lp:do
Diff against target: None lines
To merge this branch: bzr merge lp:~jassmith/do/thirdsearchcontrollerfix
Reviewer Review Type Date Requested Status
Jason Smith (community) Approve
Robert Dyer (community) Approve
Review via email: mp+7864@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jason Smith (jassmith) wrote :

Forgot to use a .Safe causing an exception in usage

Revision history for this message
Robert Dyer (psybers) :
review: Approve
Revision history for this message
Jason Smith (jassmith) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Do/src/Do.Core/ThirdSearchController.cs'
2--- Do/src/Do.Core/ThirdSearchController.cs 2009-06-20 04:14:38 +0000
3+++ Do/src/Do.Core/ThirdSearchController.cs 2009-06-24 21:19:28 +0000
4@@ -63,10 +63,10 @@
5
6 if (first.IsAction () && first.AsAction ().Safe.SupportsItem (second))
7 return first.AsAction ();
8- else if (second.IsAction () && second.AsAction ().SupportsItem (first))
9+ else if (second.IsAction () && second.AsAction ().Safe.SupportsItem (first))
10 return second.AsAction ();
11 // fixme
12- throw new Exception ("Something strange happened");
13+ throw new Exception ("Could not get contextual action");
14 }
15
16 Item GetContextualItem ()
17@@ -81,10 +81,10 @@
18
19 if (first.IsAction () && first.AsAction ().Safe.SupportsItem (second))
20 return second;
21- else if (second.IsAction () && second.AsAction ().SupportsItem (first))
22+ else if (second.IsAction () && second.AsAction ().Safe.SupportsItem (first))
23 return first;
24 // fixme
25- throw new Exception ("Something strange happened");
26+ throw new Exception ("Could not get contextual item");
27 }
28
29 public ThirdSearchController(ISearchController FirstController, ISearchController SecondController) : base ()