diff --git a/Libraries/UniversalEditor.Core/ObjectModelReference.cs b/Libraries/UniversalEditor.Core/ObjectModelReference.cs index ca6a888a..d88df384 100644 --- a/Libraries/UniversalEditor.Core/ObjectModelReference.cs +++ b/Libraries/UniversalEditor.Core/ObjectModelReference.cs @@ -95,6 +95,16 @@ namespace UniversalEditor /// True if an with the specified ID exists in the collection; false otherwise. public bool Contains(Guid ID) { + if (refsByID.Count == 0) + { + foreach (ObjectModelReference omr in this) + { + if (omr.ID != Guid.Empty) + { + refsByID.Add(omr.ID, omr); + } + } + } return (refsByID.ContainsKey(ID)); } ///