From bfb62359b05e905fea6bb8f02c9b06d2c692c5f9 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Sat, 23 Nov 2024 10:10:06 +0000 Subject: [PATCH] handle missing admin ids --- src/player.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/player.rs b/src/player.rs index 807d12e..b765657 100644 --- a/src/player.rs +++ b/src/player.rs @@ -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; }