Skip to content

Commit

Permalink
Fix NPE when trying to bootstrap delete security instance at client side
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernard31 committed May 30, 2022
1 parent dd09a4f commit faec24d
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -401,7 +401,10 @@ public BootstrapDeleteResponse doDelete(ServerIdentity identity, BootstrapDelete
if (id == LwM2mId.SECURITY) {
// For security object, deleting bootstrap Server account is not allowed
LwM2mInstanceEnabler instance = instances.get(request.getPath().getObjectInstanceId());
if (ServersInfoExtractor.isBootstrapServer(instance)) {
if (instance == null) {
return BootstrapDeleteResponse
.badRequest(String.format("Instance %s not found", request.getPath()));
} else if (ServersInfoExtractor.isBootstrapServer(instance)) {
return BootstrapDeleteResponse.badRequest("bootstrap server can not be deleted");
}
}
Expand Down

0 comments on commit faec24d

Please sign in to comment.