Skip to content

Commit

Permalink
MINOR Fixing "No current controller available" error when TestSession…
Browse files Browse the repository at this point in the history
…::__destruct() is called
  • Loading branch information
Sean Harvey committed May 24, 2012
1 parent 9074f52 commit b325fea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dev/TestSession.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ function __construct() {
function __destruct() { function __destruct() {
// Shift off anything else that's on the stack. This can happen if something throws // Shift off anything else that's on the stack. This can happen if something throws
// an exception that causes a premature TestSession::__destruct() call // an exception that causes a premature TestSession::__destruct() call
while(Controller::curr() != $this->controller) Controller::curr()->popCurrent(); while(Controller::has_curr() && Controller::curr() !== $this->controller) Controller::curr()->popCurrent();


$this->controller->popCurrent(); if(Controller::has_curr()) $this->controller->popCurrent();
} }


/** /**
Expand Down

0 comments on commit b325fea

Please sign in to comment.