Showing
2 changed files
with
4 additions
and
4 deletions
... | ... | @@ -126,11 +126,11 @@ public class DeviceController extends BaseController { |
126 | 126 | |
127 | 127 | checkEntity(device.getId(), device, Resource.DEVICE); |
128 | 128 | |
129 | - Device oldDevice; | |
129 | + Device oldDevice = null; | |
130 | 130 | if (!created) { |
131 | - oldDevice = deviceService.findDeviceById(getTenantId(), device.getId()); | |
131 | + oldDevice = checkDeviceId(device.getId(), Operation.WRITE); | |
132 | 132 | } else { |
133 | - oldDevice = null; | |
133 | + checkEntity(null, device, Resource.DEVICE); | |
134 | 134 | } |
135 | 135 | |
136 | 136 | Device savedDevice = checkNotNull(deviceService.saveDeviceWithAccessToken(device, accessToken)); | ... | ... |
... | ... | @@ -18,10 +18,10 @@ package org.thingsboard.server.service.rpc; |
18 | 18 | import lombok.Getter; |
19 | 19 | import lombok.RequiredArgsConstructor; |
20 | 20 | import lombok.ToString; |
21 | -import org.thingsboard.rule.engine.api.msg.ToDeviceActorNotificationMsg; | |
22 | 21 | import org.thingsboard.server.common.data.id.DeviceId; |
23 | 22 | import org.thingsboard.server.common.data.id.TenantId; |
24 | 23 | import org.thingsboard.server.common.msg.MsgType; |
24 | +import org.thingsboard.server.common.msg.ToDeviceActorNotificationMsg; | |
25 | 25 | |
26 | 26 | import java.util.UUID; |
27 | 27 | ... | ... |