Null Reference Exception in GetSelectedEnumValue

Morning all,

This one has be stumped… any idea why the exception is thrown?

image

stack trace is
at Rhino.Input.Custom.GetBaseClass.GetSelectedEnumValueFromSelectionList[T](IEnumerable`1 selectionList)
at myCodes.cs:line 97

Hi @david.birch.uk,

The attached seems to work. Let me know if it helps.

TestDavid.cs (1.6 KB)

– Dale

Thank you Dale, I can confirm this works.

I was previously trying to read the enum value after my get loop (as with all other options which have a OptionDouble or similar object).

Moving the reading of the enum within the loop as you have it does indeed work :slight_smile: