Give a better error if User::class has been screwed up somehow

This commit is contained in:
Shish 2014-12-07 03:44:03 +00:00
parent 88f1df9ca6
commit 316f7ff858

View file

@ -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"]}'");
}
}
/**