Skip to content

Commit

Permalink
Fix Levels and Family wrapper names causing crash when link is unload…
Browse files Browse the repository at this point in the history
…ed (#2998)
  • Loading branch information
dariaivanciucova authored Nov 16, 2023
1 parent d56f2e5 commit 0d153cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Libraries/RevitNodes/Elements/Family.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ internal static Family FromExisting(Autodesk.Revit.DB.Family family, bool isRevi

public override string ToString()
{
return String.Format("Family: {0}", InternalFamily.Name);
return InternalFamily.IsValidObject ? String.Format("Family: {0}", InternalFamily.Name) : "empty";
}

#endregion
Expand Down
2 changes: 1 addition & 1 deletion src/Libraries/RevitNodes/Elements/Level.cs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ internal static Level FromExisting(Autodesk.Revit.DB.Level level, bool isRevitOw

public override string ToString()
{
return string.Format("Level(Name={0}, Elevation={1})", Name, Elevation);
return InternalLevel.IsValidObject ? string.Format("Level(Name={0}, Elevation={1})", Name, Elevation) : "empty";
}

}
Expand Down

0 comments on commit 0d153cf

Please sign in to comment.