Give a better error if User::class has been screwed up somehow
This commit is contained in:
parent
88f1df9ca6
commit
316f7ff858
1 changed files with 7 additions and 1 deletions
|
@ -55,7 +55,13 @@ class User {
|
|||
$this->email = $row['email'];
|
||||
$this->join_date = $row['joindate'];
|
||||
$this->passhash = $row['pass'];
|
||||
$this->class = $_user_classes[$row["class"]];
|
||||
|
||||
if(array_key_exists($row["class"], $_user_classes)) {
|
||||
$this->class = $_user_classes[$row["class"]];
|
||||
}
|
||||
else {
|
||||
throw SCoreException("User '{$this->name}' has invalid class '{$row["class"]}'");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Reference in a new issue