Skip to content

Commit 9faf596

Browse files
committed
Merge branch 'dev' of https://github.com/ExMod-Team/EXILED into dev
2 parents dd9d0af + ed2f69c commit 9faf596

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

EXILED/Exiled.API/Extensions/EffectTypeExtension.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ namespace Exiled.API.Extensions
1515
using CustomPlayerEffects;
1616
using CustomRendering;
1717
using Enums;
18+
using Exiled.API.Features;
1819
using InventorySystem.Items.MarshmallowMan;
1920
using InventorySystem.Items.Usables.Scp244.Hypothermia;
2021
using PlayerRoles.FirstPersonControl;
@@ -131,7 +132,15 @@ public static bool TryGetType(this EffectType effect, out Type type)
131132
/// <param name="statusEffectBase">The <see cref="StatusEffectBase"/> enum.</param>
132133
/// <returns>The <see cref="EffectType"/>.</returns>
133134
public static EffectType GetEffectType(this StatusEffectBase statusEffectBase)
134-
=> TypeToEffectType.TryGetValue(statusEffectBase.GetType(), out EffectType effect) ? effect : throw new InvalidOperationException("Invalid effect status base provided");
135+
{
136+
if (!TypeToEffectType.TryGetValue(statusEffectBase.GetType(), out EffectType type))
137+
{
138+
Log.Warn($"Missing EffectType for Type {statusEffectBase.GetType()}!!! This issue likely originates from a new update or a CustomEffect on your Server");
139+
return EffectType.None;
140+
}
141+
142+
return type;
143+
}
135144

136145
/// <summary>
137146
/// Gets the <see cref="EffectType"/> of the specified <see cref="StatusEffectBase"/>.

0 commit comments

Comments
 (0)