Skip to content

Commit

Permalink
handle missing admin ids
Browse files Browse the repository at this point in the history
  • Loading branch information
harryob committed Nov 23, 2024
1 parent 45112cb commit bfb6235
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,17 @@ impl Player {
self.job_bans = jobbans
}

if self.is_permabanned.is_some() && self.is_permabanned.unwrap() != 0 {
if self.is_permabanned.is_some()
&& self.is_permabanned.unwrap() != 0
&& self.permaban_admin_id.is_some()
{
self.permaban_admin_ckey = get_player_ckey(db, self.permaban_admin_id.unwrap()).await;
}

if self.is_time_banned.is_some() && self.is_time_banned.unwrap() != 0 {
if self.is_time_banned.is_some()
&& self.is_time_banned.unwrap() != 0
&& self.time_ban_admin_id.is_some()
{
self.time_ban_admin_ckey = get_player_ckey(db, self.time_ban_admin_id.unwrap()).await;
}

Expand Down

0 comments on commit bfb6235

Please sign in to comment.