Skip to content
Browse files

MINOR Fixing "No current controller available" error when TestSession…

…::__destruct() is called
  • Loading branch information...
1 parent 9074f52 commit b325fea709ca60e6dba0c9fb4c24953c0c4ec2c5 @halkyon halkyon committed May 24, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 dev/TestSession.php
View
4 dev/TestSession.php
@@ -32,9 +32,9 @@ function __construct() {
function __destruct() {
// Shift off anything else that's on the stack. This can happen if something throws
// 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();
}
/**

0 comments on commit b325fea

Please sign in to comment.
Something went wrong with that request. Please try again.