Skip to content
Snippets Groups Projects
Commit eed4950a authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

Throw an exception in SimpleSAML_Auth_Simple when the auth source cannot be...

Throw an exception in SimpleSAML_Auth_Simple when the auth source cannot be found. This avoids trying to access a method in an object that's actually null.
parent 74904960
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,11 @@ class SimpleSAML_Auth_Simple {
* @return SimpleSAML_Auth_Source The authentication source.
*/
public function getAuthSource() {
return SimpleSAML_Auth_Source::getById($this->authSource);
$as = SimpleSAML_Auth_Source::getById($this->authSource);
if ($as === null) {
throw new SimpleSAML_Error_Exception('Invalid authentication source: '.$this->authSource);
}
return $as;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment