From 38969a1477702fc16222ec55e1b45fb6bb0b4321 Mon Sep 17 00:00:00 2001 From: Paulo Dias Date: Thu, 26 Sep 2024 17:05:04 +0100 Subject: [PATCH] mra/exporters/CSVExporter: Fix aanother potential buffer underflow exception. --- .../pt/lsts/neptus/mra/exporters/CSVExporter.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/java/pt/lsts/neptus/mra/exporters/CSVExporter.java b/src/java/pt/lsts/neptus/mra/exporters/CSVExporter.java index 62eee6a515..09a84c0f62 100644 --- a/src/java/pt/lsts/neptus/mra/exporters/CSVExporter.java +++ b/src/java/pt/lsts/neptus/mra/exporters/CSVExporter.java @@ -297,13 +297,18 @@ private void applyFilter(boolean entFiles) { pmonitor.setNote(I18n.textf("Exporting %message data to %csvfile...", message, out.getAbsolutePath())); bw.write(getHeader(message)); for (int row = 0; row < source.getLsfIndex().getNumberOfMessages(); row++) { - if (source.getLsfIndex().getMessage(row).getMessageType().getShortName().equals(message)) { - if (entities.contains(source.getLsfIndex().entityNameOf(row))) { - bw.write(getLine(source.getLsfIndex().getMessage(row))); + try { + if (source.getLsfIndex().getMessage(row).getMessageType().getShortName().equals(message)) { + if (entities.contains(source.getLsfIndex().entityNameOf(row))) { + bw.write(getLine(source.getLsfIndex().getMessage(row))); + } + } + if (!filter.isVisible()) { + break; } + } catch (Exception e) { + NeptusLog.pub().warn(e.getMessage()); } - if (!filter.isVisible()) - break; } bw.close(); progress++;