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

Commit

Permalink
change in the AID Plugin.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
hapakala committed Mar 11, 2024
1 parent 2a4ca46 commit 467cb08
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/AasxPluginAID/AIDAnyUiControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -898,8 +898,15 @@ private async Task<AnyUiLambdaActionBase> ButtonTabPanels_Click(string cmd, stri
var salt = Guid.NewGuid().ToString().Substring(0, 8);
var targetFn = String.Format("{0}_{1}{2}", onlyFn, salt, onlyExt);

int submodelELementCount = 0;

if (_submodel.SubmodelElements != null )
{
submodelELementCount = _submodel.SubmodelElements.Count;
}

var desc = AIDTDImport.CreateAssetInterfaceDescriptionFromTd(tdJObject,
targetPath + targetFn,_submodel.Id.ToString(),_submodel.SubmodelElements.Count,"JSONLD");
targetPath + targetFn,_submodel.Id.ToString(), submodelELementCount, "JSONLD");
_submodel.Add(desc);
PushUpdatenRedrawEvent();
return new AnyUiLambdaActionRedrawAllElementsBase() { NextFocus = _submodel };
Expand Down
2 changes: 1 addition & 1 deletion src/AasxPluginAID/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public class Session : PluginSessionBase
// check for a record in options, that matches Submodel
var found = false;
// ReSharper disable once UnusedVariable
if (sm.SemanticId.GetAsExactlyOneKey().Value.ToString() == "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/Submodel")
if (sm.SemanticId?.GetAsExactlyOneKey().Value.ToString() == "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/Submodel")
found = true;
if (!found)
return null;
Expand Down

0 comments on commit 467cb08

Please sign in to comment.