Skip to content

Commit

Permalink
better fallback reporting (#3522)
Browse files Browse the repository at this point in the history
* better fallback reporting

* avoid Chars being recognized as IEnumerable
  • Loading branch information
KatKatKateryna authored Jun 19, 2024
1 parent 77829a5 commit e31969f
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Speckle.Converters.Common.Objects;
using System.Collections;
using Speckle.Converters.Common.Objects;
using Speckle.Core.Models;
using Speckle.Core.Models.Extensions;

Expand Down Expand Up @@ -49,6 +50,10 @@ public object Convert(Base target)
var displayValue = target.TryGetDisplayValue<Base>();
if (displayValue != null)
{
if (displayValue is IList && !displayValue.Any())
{
throw new NotSupportedException($"No display value found for {type}");
}
return FallbackToDisplayValue(displayValue);
}

Expand Down

0 comments on commit e31969f

Please sign in to comment.