Commit 5de49e19 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review

Merge "Bug 1828303: Make sure external auth object exists before calling logout"

parents aaeee979 77433f09
......@@ -426,7 +426,9 @@ function auth_setup () {
$authinstance = $SESSION->get('authinstance');
if ($authinstance) {
$authobj = AuthFactory::create($authinstance);
$authobj->logout();
if ($authobj) {
$authobj->logout();
}
}
else {
log_debug("Strange: user " . $USER->get('username') . " had no authinstance set in their session");
......@@ -481,8 +483,9 @@ function auth_setup () {
// they're using the local login form
$mnetuser = $USER->get('id');
}
$authobj->logout();
if ($authobj) {
$authobj->logout();
}
$USER->logout();
if ($mnetuser != 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment