Merge pull request #4347 from thingsboard/lwm2m_fix_bug_double_string

lwm2m: back fix bug format name
This commit is contained in:
nickAS21 2021-03-31 18:35:17 +03:00 committed by GitHub
commit ba7543d30e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -713,7 +713,7 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService {
private void addParameters(String path, JsonObject parameters, Registration registration) {
LwM2mClient lwM2MClient = lwM2mClientContext.getLwM2mClientWithReg(registration, null);
JsonObject names = lwM2mClientContext.getProfiles().get(lwM2MClient.getProfileId()).getPostKeyNameProfile();
String resName = String.valueOf(names.get(path));
String resName = names.get(path).getAsString();
if (resName != null && !resName.isEmpty()) {
try {
String resValue = this.getResourceValueToString(lwM2MClient, path);