Skip to content

Conversation

figloalds
Copy link

@figloalds figloalds commented Feb 20, 2025

Previously if you had a an array of complex objects including arrays inside them, you would get a NullReferenceException if the incoming data could have any of those internal arrays be empty. With the added check, the program will correctly understand the lack of value in that property path

Eg:

[
  {
    "items": [{ 
        "productId": 12, "description": "A product of all time" 
    }],
    "payments": [{ "paymentMethodId": 8, "paymentMethodName": "Credit Card", "value": 123.0 }],
    "status": "completed"
  },
  {
    "items": [{ 
        "productId": 6, "description": "Something Really Fancy"
    }]
    "payments": [],
    "status": "cancelled"
  }
]

in the model above, if you were to use a path like sales.payments.value as a totalizer, the data above would cause a NullReferenceException due to payments being an empty array, instead of the expected behavior, with the correction we get the expected result of 123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant