Skip to content

Commit

Permalink
fix(jans): added null check to avoid NullPointerException (#3077)
Browse files Browse the repository at this point in the history
  • Loading branch information
pujavs authored Nov 24, 2022
1 parent 74f9cca commit 42d49b2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 34 deletions.
49 changes: 19 additions & 30 deletions jans-config-api/docs/jans-config-api-swagger-auto.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7178,19 +7178,19 @@ components:
$ref: '#/components/schemas/AttributeValidation'
tooltip:
type: string
adminCanAccess:
type: boolean
userCanAccess:
whitePagesCanView:
type: boolean
userCanView:
adminCanAccess:
type: boolean
adminCanView:
type: boolean
userCanEdit:
userCanAccess:
type: boolean
adminCanEdit:
type: boolean
whitePagesCanView:
userCanView:
type: boolean
userCanEdit:
type: boolean
baseDn:
type: string
Expand Down Expand Up @@ -7526,10 +7526,6 @@ components:
ttl:
type: integer
format: int32
displayName:
type: string
tokenBindingSupported:
type: boolean
authenticationMethod:
type: string
enum:
Expand Down Expand Up @@ -7646,13 +7642,6 @@ components:
type: object
additionalProperties:
type: string
value:
type: string
languageTags:
uniqueItems: true
type: array
items:
type: string
AppConfiguration:
type: object
properties:
Expand Down Expand Up @@ -8345,17 +8334,6 @@ components:
$ref: '#/components/schemas/EngineConfig'
ssaConfiguration:
$ref: '#/components/schemas/SsaConfiguration'
fapi:
type: boolean
allResponseTypesSupported:
uniqueItems: true
type: array
items:
type: string
enum:
- code
- token
- id_token
enabledFeatureFlags:
uniqueItems: true
type: array
Expand Down Expand Up @@ -8383,6 +8361,17 @@ components:
- STAT
- PAR
- SSA
allResponseTypesSupported:
uniqueItems: true
type: array
items:
type: string
enum:
- code
- token
- id_token
fapi:
type: boolean
AuthenticationFilter:
required:
- baseDn
Expand Down Expand Up @@ -8639,13 +8628,13 @@ components:
type: boolean
internal:
type: boolean
locationPath:
type: string
locationType:
type: string
enum:
- ldap
- file
locationPath:
type: string
baseDn:
type: string
ScriptError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ public Object getValue() {
return null;
}

if (this.values.size() > 0) {
if (!this.values.isEmpty()) {
return this.values.get(0);
}

return null;
}

public void setValue(Object value) {
this.values = new ArrayList<Object>();
this.values = new ArrayList<>();
this.values.add(value);
this.multiValued = false;
}
Expand Down Expand Up @@ -89,7 +89,7 @@ public String getDisplayValue() {
}

if (values.size() == 1) {
return values.get(0).toString();
return (values.get(0)!=null ? values.get(0).toString() : "");
}

StringBuilder sb = new StringBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ public int size() {
return values.size();
}

@SuppressWarnings("unchecked")
@JsonIgnore
public Set<String> getLanguageTags() {
return values.keySet();
return (values!=null ? values.keySet() : Collections.emptySet());
}

public String addLdapLanguageTag(String ldapAttributeName, String languageTag) {
Expand Down

0 comments on commit 42d49b2

Please sign in to comment.