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
sbernard31 committed May 30, 2022

Verified

This commit was signed with the committer’s verified signature. The key has expired.
mmarchini mary marchini
1 parent dd09a4f commit faec24d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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");
}
}

0 comments on commit faec24d

Please sign in to comment.