specklesystems / speckle-sharp

.NET SDK, Schema and Connectors: Revit, Rhino, Grasshopper, Dynamo, ETABS, AutoCAD, Civil3D & more.
https://speckle.systems
Apache License 2.0
372 stars 170 forks source link

Bug: Rhino Converter throws an error when unnamed collections are filtered #3291

Open secretlyagoblin opened 6 months ago

secretlyagoblin commented 6 months ago

https://github.com/specklesystems/speckle-sharp/blob/b67e46c0dc3eee8572f4cf9c9cdef339949f536b/Objects/Converters/ConverterRhinoGh/ConverterRhinoGhShared/ConverterRhinoGh.cs#L740

If the collectionType is null in this case it silently throws and nothing in the collection loads, showing a successful pull.

should be

      case Collection c when ! (c.collectionType?.ToLower().Contains("model") ?? false):
AlanRynne commented 5 months ago

Hi @secretlyagoblin, thx for reporting this!

Where is the commit you're trying to receive from? (Revit, Rhino...). Could you share it with us so we could have a look?

I don't recall us changing any logic here, but I'd need to check the history to confirm.

secretlyagoblin commented 5 months ago

We're making our own commits via custom code, but when creating collections, collectionType defaults to null, not "". So as a result, our custom collections are causing the converter to crash.

The fix is for us to explicitly set collectionType to "" instead of null, but either way, there should be a null check here if collectionType is to remain nullable.