Skip to content

Commit

Permalink
fix: Null value handling for all NFT Data features while Deserializin…
Browse files Browse the repository at this point in the history
…g data
  • Loading branch information
saszer committed Jun 7, 2022
1 parent f66aab8 commit fac3856
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
9 changes: 8 additions & 1 deletion Runtime/NFT_Details.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public static NFT_Details Initialize(bool destroyAtEnd = true)
/// </summary>
/// <param name="contract_address"> as string.</param>
/// <param name="token_id"> as int.</param>
/// <param name="refresh_metadata"> Queues and refreshes the metadata of the token if it has changed since the updated_date. Useful for example, when NFT collections are revealed or upgraded</param>
public NFT_Details SetParameters(string contract_address = null, int token_id = -1, bool refresh_metadata = false)
{
if(contract_address!=null)
Expand Down Expand Up @@ -193,7 +194,13 @@ IEnumerator CallAPIProcess()
else
{
//Fill Data Model from recieved class
NFTs = JsonConvert.DeserializeObject<NFTs_model>(jsonResult);
NFTs = JsonConvert.DeserializeObject<NFTs_model>(
jsonResult,
new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore,
MissingMemberHandling = MissingMemberHandling.Ignore
});

if(OnCompleteAction!=null)
OnCompleteAction.Invoke(NFTs);
Expand Down
8 changes: 7 additions & 1 deletion Runtime/NFTs_OfAContract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,13 @@ IEnumerator CallAPIProcess()
else
{
//Fill Data Model from recieved class
NFTs = JsonConvert.DeserializeObject<NFTs_model>(jsonResult);
NFTs = JsonConvert.DeserializeObject<NFTs_model>(
jsonResult,
new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore,
MissingMemberHandling = MissingMemberHandling.Ignore
});

if(OnCompleteAction!=null)
OnCompleteAction.Invoke(NFTs);
Expand Down
8 changes: 7 additions & 1 deletion Runtime/NFTs_OwnedByAnAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,13 @@ IEnumerator CallAPIProcess()
else
{
//Fill Data Model from recieved class
NFTs = JsonConvert.DeserializeObject<NFTs_model>(jsonResult);
NFTs = JsonConvert.DeserializeObject<NFTs_model>(
jsonResult,
new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore,
MissingMemberHandling = MissingMemberHandling.Ignore
});

if(OnCompleteAction!=null)
OnCompleteAction.Invoke(NFTs);
Expand Down

0 comments on commit fac3856

Please sign in to comment.