Fix exception on load a non existing player

This commit is contained in:
slawkens
2026-01-04 15:28:58 +01:00
parent 57d4111ad8
commit fcdd6debae

View File

@@ -148,7 +148,8 @@ class OTS_Player extends OTS_Row_DAO
array_unshift($columns, 'id');
$this->data = PlayerModel::where('id', $id)->first($columns)->toArray();
$query = PlayerModel::where('id', $id)->first($columns);
$this->data = $query ? $query->toArray() : [];
// loads skills
if( $this->isLoaded() && $load_skills) {