Skip to content

Conversation

@HG-Dev
Copy link

@HG-Dev HG-Dev commented Nov 4, 2025

Apropos of no preexisting issue, for your consideration:

When aggregating ModifierStack objects for VectorLayerVisualizer, it cannot be assumed that all serialized list entries are non-null, as they come from the Editor. Thus, it is benefitial to clarify the reason NullReferenceExceptions are given when iterating over their collection.

Additionally, the AddModifierStack method may add multiple ModifierStack objects, implying that it should be named "AddModifierStacks". Also, it does not need a List to function.

If you have different ideas for the future of AddModifierStack, please close this pull request, and consider the NullReferenceException modification for future scenarios where serialized data is referenced via LINQ or otherwise.

Description of changes

VectorLayerVisualizerObject

  • LINQ ModifierStackObject aggregating expression tests if stack is null, and if it is, it raises an exception with an explanation of what is null

VectorLayerVisualizer, IVectorLayerVisualizer

  • AddModifierStack signature changed to AddModifierStacks(IEnumerable<ModifierStack> stacks)

Reviewers

@brnkhy

…AddModifierStack to AddModifierStacks as it adds a range of ModifierStack objects, and identify its parameter as IEnumerable because it only enumerates the given collection
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