-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvement suggestion: 2D lists with empty sublists triggers "Dereferencing a non-pointer" exception #8411
Comments
@ThomasMahon is this exception thrown with a particular node or most nodes in general? Could you share a simple graph to demonstrate the workflow? Thanks! |
@aparajit-pratap its any property node from any library. Here are some examples, example graph attached. It seems to be null that causes the exception as I've input null to the list as a test and also flattened and still see the problem. I read on MSDN that if exceptions are expected with properties, make them methods instead, but that is clearly impractical: Example Dereferencing a non-pointer.zip |
@aparajit-pratap also, look what happens if the first item contains an object that isn't null or an empty list, oddly, it works as expected. So it seems if the first object is null, the property fails: |
Looks similar to #5238 |
Thanks @ThomasMahon. This issue was partly addressed for methods here but unfortunately still persists for properties. We'll make a note of it but cannot promise a fix for 2.0. |
@aparajit-pratap thanks for the update. Any chance in the meantime you could update the exception message to provide the user with more instructions on how to resolve? |
This is being fixed in 2.2 release. |
@reddyashish Can you point to the PR and close this? |
Fixed in #9559 |
Dynamo version
1.3.2
Operating system
Win 10
Improvement Suggestion
I found that any 'property' node will throw an exception if a 2D list is input where the sublists contain both objects and sublists that are empty. The solution is to remove the empty sublists or flatten the list, but its not immediately obvious to users and could easily be bypassed with a better implementation in Dynamos VM.
For example, BimorphNodes Element.IntersectsElement, or Element.IntersectsSolid output lists of this strucutre to enable the user to understand if there are any clashes. If no clashes are found, empty sublists are returned to indicate 'no clashes'. If clashes are found, the sublists are populated with the clashing elements. Maintaining the data structure is very important to enable the user to ascertain where the clashes are located, so avoiding this problem via the node itself is not an option. If the output is connected to, say, Element.Solids node, the exception is thrown. If the list is flattened or the empty sublists removed, no exception is thrown and the expected behaviour is observed (nulls where the sublists are empty).
Can this behaviour be improved as it inhibits usability and creates an unnecessary abstraction to users (this issues is not specific to BimorphNodes for the record)?
I should add, creating methods which return the desired members (say, solids) is one solution, however this then screws up the library structure and 'shifts' the problem.
The text was updated successfully, but these errors were encountered: