Skip to content

fix(config-api): custom script creation failing #11307

@pujavs

Description

@pujavs

Describe the bug
Getting NPE on custom script creation

To Reproduce
Steps to reproduce the behavior:

  1. Create script.json with details. Do not specify loctionType field
  2. See error

{
"cause1":"java.lang.NullPointerException: Cannot invoke
"io.jans.model.ScriptLocationType.getValue()" because the return value of
"io.jans.model.custom.script.model.CustomScript.getLocationType()" is null",
"servlet":"io.jans.configapi.rest.ApiApplication",
"cause0":"org.jboss.resteasy.spi.UnhandledException:
java.lang.NullPointerException: Cannot invoke
"io.jans.model.ScriptLocationType.getValue()" because the return value of
"io.jans.model.custom.script.model.CustomScript.getLocationType()" is null",
"message":"org.jboss.resteasy.spi.UnhandledException:
java.lang.NullPointerException: Cannot invoke
"io.jans.model.ScriptLocationType.getValue()" because the return value of
"io.jans.model.custom.script.model.CustomScript.getLocationType()" is null",
"url":"/jans-config-api/api/v1/config/scripts",
"status":"500"
}

Expected behavior
Create Script should get created without error

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

kind-bugIssue or PR is a bug in existing functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions