Fix issue in get devices with since parameter.

4.x.x
charitha 8 years ago
parent f29b9e84f2
commit 3575c9a33d

@ -51,6 +51,7 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -128,7 +129,9 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
request.setSince(sinceDate); request.setSince(sinceDate);
result = dms.getAllDevices(request); result = dms.getAllDevices(request);
if (result == null || result.getData() == null || result.getData().size() <= 0) { if (result == null || result.getData() == null || result.getData().size() <= 0) {
return Response.status(Response.Status.OK).entity(new JsonArray()).build(); devices.setList(new ArrayList<Device>());
devices.setCount(0);
return Response.status(Response.Status.OK).entity(devices).build();
} }
} else { } else {
result = dms.getAllDevices(request); result = dms.getAllDevices(request);

Loading…
Cancel
Save