Skip to content

Commit

Permalink
better fallback reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
KatKatKateryna committed Jun 17, 2024
1 parent 8405135 commit c27c068
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 IEnumerable && !displayValue.Any())
{
throw new NotSupportedException($"No display value found for {type}");
}
return FallbackToDisplayValue(displayValue);
}

Expand Down

0 comments on commit c27c068

Please sign in to comment.