Skip to content

Commit

Permalink
fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
ElizabethOkerio committed May 19, 2022
1 parent 41f34f0 commit 9589777
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private IEnumerable<IEdmStructuralProperty> ComputeDeclaredKey()
foreach (CsdlPropertyReference keyProperty in this.entity.Key.Properties)
{
IEdmStructuralProperty structuralProperty = null;
if (!string.IsNullOrEmpty(keyProperty.Alias))
if (!string.IsNullOrEmpty(keyProperty?.Alias))
{
string[] keyPropertySegments = keyProperty.PropertyName.Split('/');
if (keyPropertySegments.Length > 0)
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.OData.Edm/Schema/EdmEntityType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public void AddKeys(IEnumerable<IEdmStructuralProperty> keyProperties)

//The Key property is the last segment in the path segment.
IEdmStructuralPropertyAlias structuralPropertyAlias = property as IEdmStructuralPropertyAlias;
if (!string.IsNullOrEmpty(structuralPropertyAlias.PropertyAlias))
if (!string.IsNullOrEmpty(structuralPropertyAlias?.PropertyAlias))
{
string[] keyPropertySegments = structuralPropertyAlias.Path.ToArray();
IEdmStructuralProperty structuralProperty = this.FindProperty(keyPropertySegments[0]) as IEdmStructuralProperty;
Expand Down

0 comments on commit 9589777

Please sign in to comment.