diff --git a/sources/RevitDBExplorer/Domain/DataModel/MemberAccessors/Element/Element_BoundingBox.cs b/sources/RevitDBExplorer/Domain/DataModel/MemberAccessors/Element/Element_BoundingBox.cs index 96ebfef..2ed951c 100644 --- a/sources/RevitDBExplorer/Domain/DataModel/MemberAccessors/Element/Element_BoundingBox.cs +++ b/sources/RevitDBExplorer/Domain/DataModel/MemberAccessors/Element/Element_BoundingBox.cs @@ -20,7 +20,10 @@ public Element_BoundingBox() : base((document, element) => element.get_BoundingB private static IEnumerable Snoop(Document document, Element element) { yield return new SnoopableObject(document, null, new[] { new SnoopableObject(document, element.get_BoundingBox(null)) }) { NamePrefix = "view:" }; - yield return new SnoopableObject(document, null, new[] { new SnoopableObject(document, element.get_BoundingBox(document.ActiveView)) }) { NamePrefix = "view:", Name = "Active view: " + document.ActiveView.Name }; + if (document.ActiveView != null) + { + yield return new SnoopableObject(document, null, new[] { new SnoopableObject(document, element.get_BoundingBox(document.ActiveView)) }) { NamePrefix = "view:", Name = "Active view: " + document.ActiveView.Name }; + } } }