web3-unity-sdk
web3-unity-sdk copied to clipboard
MoralisQuery FirstOrDefaultAsync don't check if the item is null
In the class MoralisQuery in the FirstOrDefaultAsync method, the SDK doens't check if the item is null which causes a NullRefException.
What the function should be :
public async UniTask<T> FirstOrDefaultAsync(CancellationToken cancellationToken)
{
EnsureNotInstallationQuery();
T item = await QueryService.FirstAsync<T>(this, SessionToken, cancellationToken);
if (item != null)
{
item.ObjectService = this.QueryService.ObjectService;
item.sessionToken = this.SessionToken;
return item;
}
return null;
}
Thank you for reporting this. We will look into this.
Any news for a fix for this ? I am forced to maintain a local version of the SDK for my project with this fix. Not a big problem in itself but I have to think about it with each SDK update.