From fd2501a9afaa37bea95e204efc85197557935110 Mon Sep 17 00:00:00 2001 From: Oscar <29248751+oscar-wos@users.noreply.github.com> Date: Wed, 23 Oct 2024 08:32:48 +0100 Subject: [PATCH] fix: invalid object reference --- src/Globals.cs | 2 +- src/Refiller.cs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Globals.cs b/src/Globals.cs index 32a3b6d..074671d 100644 --- a/src/Globals.cs +++ b/src/Globals.cs @@ -5,5 +5,5 @@ public partial class Refiller public RefillerConfig Config { get; set; } = new(); public override string ModuleName => "Refiller"; public override string ModuleAuthor => "github.com/oscar-wos/Refiller"; - public override string ModuleVersion => "1.0.0"; + public override string ModuleVersion => "1.0.1"; } \ No newline at end of file diff --git a/src/Refiller.cs b/src/Refiller.cs index 07beb64..26e6193 100644 --- a/src/Refiller.cs +++ b/src/Refiller.cs @@ -1,7 +1,6 @@ using CounterStrikeSharp.API; using CounterStrikeSharp.API.Core; using CounterStrikeSharp.API.Modules.Utils; -using Microsoft.Extensions.Logging; namespace Refiller; @@ -42,7 +41,7 @@ public HookResult OnPlayerDeath(EventPlayerDeath @event, GameEventInfo info) Server.NextFrame(() => { - foreach (var weapon in weapons) + foreach (var weapon in weapons.Where(w => w != null && w.IsValid)) { var weaponData = weapon.Value!.As().VData;