Skip to content

Commit

Permalink
ClientProfileProvider returns Profile only when registration is found
Browse files Browse the repository at this point in the history
  • Loading branch information
JaroslawLegierski authored and sbernard31 committed Jul 3, 2023
1 parent 1186c01 commit ec90257
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ public DefaultClientProfileProvider(RegistrationStore registrationStore, LwM2mMo
@Override
public ClientProfile getProfile(LwM2mIdentity identity) {
Registration registration = registrationStore.getRegistrationByIdentity(identity);
LwM2mModel model = modelProvider.getObjectModel(registration);
return new ClientProfile(registration, model);
if (registration != null) {
LwM2mModel model = modelProvider.getObjectModel(registration);
return new ClientProfile(registration, model);
} else
return null;
}

}

0 comments on commit ec90257

Please sign in to comment.