Showing
1 changed file
with
3 additions
and
3 deletions
... | ... | @@ -282,14 +282,14 @@ public class TelemetryRestMsgHandler extends DefaultRestMsgHandler { |
282 | 282 | throw new IllegalArgumentException(e.getMessage()); |
283 | 283 | } |
284 | 284 | List<TsKvEntry> entries = new ArrayList<>(); |
285 | - if (entries.isEmpty()) { | |
286 | - throw new IllegalArgumentException("No timeseries data found in request body!"); | |
287 | - } | |
288 | 285 | for (Map.Entry<Long, List<KvEntry>> entry : telemetryRequest.getData().entrySet()) { |
289 | 286 | for (KvEntry kv : entry.getValue()) { |
290 | 287 | entries.add(new BasicTsKvEntry(entry.getKey(), kv)); |
291 | 288 | } |
292 | 289 | } |
290 | + if (entries.isEmpty()) { | |
291 | + throw new IllegalArgumentException("No timeseries data found in request body!"); | |
292 | + } | |
293 | 293 | ctx.saveTsData(entityId, entries, ttl, new PluginCallback<Void>() { |
294 | 294 | @Override |
295 | 295 | public void onSuccess(PluginContext ctx, Void value) { | ... | ... |