mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-25 06:05:46 +03:00
Fixed NRE in inventory result dispose
This commit is contained in:
parent
2ee5fa4a5d
commit
c4617c5884
@ -14,7 +14,7 @@ public class Result : IDisposable
|
||||
internal static Dictionary< int, Result > Pending;
|
||||
internal Inventory inventory;
|
||||
|
||||
private SteamNative.SteamInventoryResult_t Handle { get; set; }
|
||||
private SteamNative.SteamInventoryResult_t Handle { get; set; } = -1;
|
||||
|
||||
/// <summary>
|
||||
/// Called when result is successfully returned
|
||||
@ -169,8 +169,12 @@ internal unsafe byte[] Serialize()
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
inventory.inventory.DestroyResult( Handle );
|
||||
Handle = -1;
|
||||
if ( Handle != -1 && inventory != null )
|
||||
{
|
||||
inventory.inventory.DestroyResult( Handle );
|
||||
Handle = -1;
|
||||
}
|
||||
|
||||
inventory = null;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user