Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
Adding null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
juileetikekar committed Oct 10, 2023
1 parent 5e56d77 commit 07c1e21
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions src/AasxPackageLogic/VisualAasxElements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This source code may use other Open Source software components (see LICENSE.txt)
using AdminShellNS;
using AnyUi;
using Extensions;
using Microsoft.IdentityModel.Tokens;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
Expand Down Expand Up @@ -1939,17 +1940,26 @@ public void AddVisualElementsFromShellEnv(

// quickly connect the Identifiables to the environment
{
foreach (var aas in env.AssetAdministrationShells)
if (aas != null)
aas.Parent = env;
if (!env.AssetAdministrationShells.IsNullOrEmpty())
{
foreach (var aas in env.AssetAdministrationShells)
if (aas != null)
aas.Parent = env;
}

foreach (var sm in env.Submodels)
if (sm != null)
sm.Parent = env;
if (!env.Submodels.IsNullOrEmpty())
{
foreach (var sm in env.Submodels)
if (sm != null)
sm.Parent = env;
}

foreach (var cd in env.ConceptDescriptions)
if (cd != null)
cd.Parent = env;
if (!env.ConceptDescriptions.IsNullOrEmpty())
{
foreach (var cd in env.ConceptDescriptions)
if (cd != null)
cd.Parent = env;
}
}

// many operations
Expand Down

0 comments on commit 07c1e21

Please sign in to comment.