Dont trigger event functions if the passed pointer is nil

This commit is contained in:
Deukhoofd 2021-07-09 18:19:38 +02:00
parent 6ecbae0370
commit c2d846c2f6
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 4 additions and 0 deletions

View File

@ -51,6 +51,10 @@ namespace PkmnLibSharp.Battling.Events
private async Task InternalRunner(IntPtr ptr)
{
if (ptr == IntPtr.Zero)
{
return;
}
var wrapped = WrapEventPtr(ptr);
await _del.Invoke(wrapped);
}