|
@@ -40,6 +40,7 @@ import io.netty.util.ReferenceCountUtil; |
|
@@ -40,6 +40,7 @@ import io.netty.util.ReferenceCountUtil; |
40
|
import io.netty.util.concurrent.Future;
|
40
|
import io.netty.util.concurrent.Future;
|
41
|
import io.netty.util.concurrent.GenericFutureListener;
|
41
|
import io.netty.util.concurrent.GenericFutureListener;
|
42
|
import lombok.extern.slf4j.Slf4j;
|
42
|
import lombok.extern.slf4j.Slf4j;
|
|
|
43
|
+import org.apache.commons.lang3.StringUtils;
|
43
|
import org.thingsboard.server.common.data.DataConstants;
|
44
|
import org.thingsboard.server.common.data.DataConstants;
|
44
|
import org.thingsboard.server.common.data.Device;
|
45
|
import org.thingsboard.server.common.data.Device;
|
45
|
import org.thingsboard.server.common.data.DeviceProfile;
|
46
|
import org.thingsboard.server.common.data.DeviceProfile;
|
|
@@ -315,7 +316,7 @@ public class MqttTransportHandler extends ChannelInboundHandlerAdapter implement |
|
@@ -315,7 +316,7 @@ public class MqttTransportHandler extends ChannelInboundHandlerAdapter implement |
315
|
transportService.process(deviceSessionCtx.getSessionInfo(), claimDeviceMsg, getPubAckCallback(ctx, msgId, claimDeviceMsg));
|
316
|
transportService.process(deviceSessionCtx.getSessionInfo(), claimDeviceMsg, getPubAckCallback(ctx, msgId, claimDeviceMsg));
|
316
|
} else if ((fwMatcher = FW_PATTERN.matcher(topicName)).find()) {
|
317
|
} else if ((fwMatcher = FW_PATTERN.matcher(topicName)).find()) {
|
317
|
String payload = mqttMsg.content().toString(UTF8);
|
318
|
String payload = mqttMsg.content().toString(UTF8);
|
318
|
- int chunkSize = payload != null ? Integer.parseInt(payload) : 0;
|
319
|
+ int chunkSize = StringUtils.isNotEmpty(payload) ? Integer.parseInt(payload) : 0;
|
319
|
String requestId = fwMatcher.group("requestId");
|
320
|
String requestId = fwMatcher.group("requestId");
|
320
|
int chunk = Integer.parseInt(fwMatcher.group("chunk"));
|
321
|
int chunk = Integer.parseInt(fwMatcher.group("chunk"));
|
321
|
|
322
|
|