From 740bf4ab31575492a9b2f77d6fedb981238fb18d Mon Sep 17 00:00:00 2001 From: Siebe Krijgsman Date: Mon, 16 Oct 2023 10:51:42 +0200 Subject: [PATCH] #61: Added check for data-less traces in legacy mode --- src/main/java/com/riscure/trs/TraceSet.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/riscure/trs/TraceSet.java b/src/main/java/com/riscure/trs/TraceSet.java index 7530b1c..4b7a5a9 100644 --- a/src/main/java/com/riscure/trs/TraceSet.java +++ b/src/main/java/com/riscure/trs/TraceSet.java @@ -161,7 +161,9 @@ public Trace get(int index) throws IOException { //legacy mode byte[] data = readData(); traceParameterMap = new TraceParameterMap(); - traceParameterMap.put("LEGACY_DATA", data); + if (data.length > 0) { + traceParameterMap.put("LEGACY_DATA", data); + } } float[] samples = readSamples();