eclipse-aaspe / package-explorer

AASX Package Explorer
Other
64 stars 19 forks source link

Null SubmodelElement raises an unhandled exception #37

Closed martafullen closed 9 months ago

martafullen commented 9 months ago

Describe the bug

Aasx files missing a SubmodelElement value raise an unhandled exception during loading.

System.NullReferenceException
  HResult=0x80004003
  Message=Object reference not set to an instance of an object.
  Source=AasxCsharpLibrary
  StackTrace:
   at Extensions.ExtendISubmodelElement.BasicConversionFromV20(ISubmodelElement submodelElement, SubmodelElement sourceSubmodelElement) in \ExtendISubmodelElement.cs:line 504

submodelElement is null:

Name Value Type
submodelElement null AasCore.Aas3_0.ISubmodelElement
sourceSubmodelElement {"notnull" } AasxCompatibilityModels.AdminShellV20.SubmodelElement {AasxCompatibilityModels.AdminShellV20.Capability}

Expected behavior Exception caught
or values checked and nulls handled

Desktop (please complete the following information):

Additional context Related issue in aasx-server: https://github.com/eclipse-aaspe/aasx-server/issues/214

juileetikekar commented 9 months ago

Hi @martafullen,

Thank you for raising the issue!!

The root cause of the issue is unhandled Capability SME during conversion. The fix will be provided asap.

juileetikekar commented 9 months ago

Hi @martafullen ,

The PR https://github.com/eclipse-aaspe/aaspe/pull/31 fixes this issue. The PR has been merged into the main branch.