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

fix(jans): added null check to avoid NullPointerException #3077

Merged
merged 1 commit into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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