Skip to content

Commit

Permalink
Fix NullPointerException.
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianboimvaser committed Apr 6, 2021
1 parent 222f146 commit 7d5a441
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,16 @@ public ConfigDescription getConfigDescription(URI uri, Locale locale) {

for (int code = 1; code <= userCodeClass.getNumberOfSupportedCodes(); code++) {
UserCode userCode = userCodeClass.getCachedUserCode(code);
boolean readOnly =
userCode != null && userCode.getState() == UserIdStatusType.RESERVED_BY_ADMINISTRATOR;
parameters.add(ConfigDescriptionParameterBuilder
.create(ZWaveBindingConstants.CONFIGURATION_USERCODE_LABEL + code, Type.TEXT)
.withLabel("Code " + code + " Label").withDescription("Name for user code " + code)
.withGroupName("usercode").build());
parameters.add(ConfigDescriptionParameterBuilder
.create(ZWaveBindingConstants.CONFIGURATION_USERCODE_CODE + code, Type.TEXT)
.withLabel("Code " + code).withDescription("Set the user code (4 to 10 numbers)")
.withReadOnly(userCode.getState() == UserIdStatusType.RESERVED_BY_ADMINISTRATOR)
.withReadOnly(readOnly)
.withGroupName("usercode").build());
}
}
Expand Down

0 comments on commit 7d5a441

Please sign in to comment.