Skip to content

Commit d3c03f7

Browse files
authored
Fixed a NullReferenceException that occurs when selecting the BoundingBox item of a linked element. (#28)
1 parent 8b1cadb commit d3c03f7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sources/RevitDBExplorer/Domain/DataModel/MemberAccessors/Element/Element_BoundingBox.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ public Element_BoundingBox() : base((document, element) => element.get_BoundingB
2020
private static IEnumerable<SnoopableObject> Snoop(Document document, Element element)
2121
{
2222
yield return new SnoopableObject(document, null, new[] { new SnoopableObject(document, element.get_BoundingBox(null)) }) { NamePrefix = "view:" };
23-
yield return new SnoopableObject(document, null, new[] { new SnoopableObject(document, element.get_BoundingBox(document.ActiveView)) }) { NamePrefix = "view:", Name = "Active view: " + document.ActiveView.Name };
23+
if (document.ActiveView != null)
24+
{
25+
yield return new SnoopableObject(document, null, new[] { new SnoopableObject(document, element.get_BoundingBox(document.ActiveView)) }) { NamePrefix = "view:", Name = "Active view: " + document.ActiveView.Name };
26+
}
2427

2528
}
2629
}

0 commit comments

Comments
 (0)