Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] NullPointerException when uploading file to Submodel Element (File) with null value #531

Open
JS-Aibel opened this issue Nov 21, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@JS-Aibel
Copy link

Describe the bug
I encountered a NullPointerException when attempting to upload a file to a Submodel Element (File) that does not have a value. The error occurs specifically when the value is not set. However, if the value is set to an empty string (""), the upload proceeds without any errors.

To Reproduce
Steps to reproduce the behavior:

  1. Create an AAS with a submodel that includes an empty Submodel Element (File).
  2. Upload the AAS to the AAS environment.
  3. Use the endpoint: PUT /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/attachment to upload a file.

Error

  • Response Status: 500
  • AAS Env Log Message: NullPointerException: Cannot invoke "String.isBlank()" because "fileName" is null

Expected behavior
The file should upload successfully without errors, regardless of whether the Submodel Element (File)'s value is null or an empty string.

BaSyx (please complete the following information):

  • BaSyx Version [v2.0]
  • AAS Version [DotAAS V3]

BaSyx configuration
Default with MongoDB

@JS-Aibel JS-Aibel added the bug Something isn't working label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: To triage
Development

No branches or pull requests

1 participant