diff --git a/WeaponPaints.cs b/WeaponPaints.cs index e1bcf6b4..2ff9d54f 100644 --- a/WeaponPaints.cs +++ b/WeaponPaints.cs @@ -46,7 +46,7 @@ public class WeaponPaints : BasePlugin var weapon = new CBasePlayerWeapon(entity.Handle); Server.NextFrame(() => { - if (!weapon.IsValid) return; + if (!weapon.IsValid || !weapon.OwnerEntity.IsValid) return; var pawn = new CBasePlayerPawn(NativeAPI.GetEntityFromIndex((int)weapon.OwnerEntity.Value.EntityIndex!.Value.Value)); if (!pawn.IsValid) return; var playerIndex = (int)pawn.Controller.Value.EntityIndex!.Value.Value; @@ -114,8 +114,7 @@ public class WeaponPaints : BasePlugin } g_playersSkins[steamId.SteamId64][weaponId] = weaponPaint; - } - ); + }); } catch (Exception) {