mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Fixing "No current controller available" error when TestSession::__destruct() is called
This commit is contained in:
parent
9074f524cc
commit
b325fea709
@ -32,9 +32,9 @@ class TestSession {
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user