Skip to content

Commit

Permalink
missing null check added
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelbaran committed Dec 12, 2022
1 parent a213515 commit 8de1d34
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Revit_Core_Engine/Query/AnalyticalOutlines.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ public static List<ICurve> AnalyticalOutlines(this HostObject hostObject, RevitS
Document doc = hostObject.Document;
AnalyticalToPhysicalAssociationManager manager = AnalyticalToPhysicalAssociationManager.GetAnalyticalToPhysicalAssociationManager(doc);
AnalyticalPanel analyticalModel = doc.GetElement(manager.GetAssociatedElementId(hostObject.Id)) as AnalyticalPanel;
if (analyticalModel == null)
return null;

List<CurveLoop> loops = new List<CurveLoop> { analyticalModel.GetOuterContour() };
loops.AddRange(analyticalModel.GetAnalyticalOpeningsIds().Select(x => (doc.GetElement(x) as AnalyticalOpening).GetOuterContour()));
Expand Down

0 comments on commit 8de1d34

Please sign in to comment.