Dynamo icon indicating copy to clipboard operation
Dynamo copied to clipboard

List.FirstItem retuning null

Open ParametricMonkey opened this issue 2 years ago • 5 comments

If this issue is not a bug report or improvement request, please check the Dynamo forum, and start a thread there to discuss your issue.

Dynamo version

2.18.1

Revit version

2024

Operating system

Windows 11

What did you do?

Some nodes, such as List.FirstItem return a null if an empty list is supplied.

What did you expect to see?

Empty list

What did you see instead?

Null.

Other nodes, such as surface by patch, simply output an empty list if the input is an empty list. But List.FirstItem returns a null. This throws an error on the node. If the error is dismissed, it is not persistent and reappears when re-opening the script.

To design out the problem, I tried Function Apply, which returns a null, but at least there is no error. But the lacing doesn't work correctly. So if there is a list of list, and not an empty list, the wrong results will be returned. So it is not a suitable workaround.

image

Error.zip

ParametricMonkey avatar Aug 09 '23 07:08 ParametricMonkey

I think returning null is fine but the node should not be put in an error state. It's a lot easier catching null values coming from this node than it would be to catch empty lists (at least in a multi level list).

andydandy74 avatar Aug 09 '23 08:08 andydandy74

Interestingly performing a 'Node to code' has the expected outcome - no errors and an empty list output. The node itself really should before the same way.

ParametricMonkey avatar Aug 11 '23 03:08 ParametricMonkey

Can we please validate and log @avidit ?

Amoursol avatar Aug 14 '23 16:08 Amoursol

Thank you for submitting the issue to us. We are sorry to see you get stuck with your workflow. While waiting for our team member to respond, please feel free to browse our forum at https://forum.dynamobim.com/ for more Dynamo related information.

github-actions[bot] avatar Aug 14 '23 16:08 github-actions[bot]

tracked internally DYN-6152

avidit avatar Aug 15 '23 15:08 avidit