Skip to content

Commit 165d077

Browse files
authored
catch rare EVIO errors (#1170)
1 parent 2ec330e commit 165d077

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CodaDecoders.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.util.logging.Logger;
88
import org.jlab.coda.jevio.CompositeData;
99
import org.jlab.coda.jevio.DataType;
10+
import org.jlab.coda.jevio.EvioCompactStructureHandler;
1011
import org.jlab.coda.jevio.EvioException;
1112
import org.jlab.coda.jevio.EvioNode;
1213
import org.jlab.detector.decode.DetectorDataDgtz.ADCData;
@@ -30,7 +31,11 @@ public class CodaDecoders {
3031
public static List<EvioTreeBranch> getEventBranches(EvioDataEvent event){
3132
ArrayList<EvioTreeBranch> branches = new ArrayList<>();
3233
try {
33-
List<EvioNode> eventNodes = event.getStructureHandler().getNodes();
34+
EvioCompactStructureHandler handler = event.getStructureHandler();
35+
if (handler == null) {
36+
return branches;
37+
}
38+
List<EvioNode> eventNodes = handler.getNodes();
3439
if (eventNodes==null) {
3540
return branches;
3641
}

common-tools/clas-io/src/main/java/org/jlab/io/evio/EvioDataEventHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public EvioDataEventHandler(ByteBuffer buff){
4747
try {
4848
structure = new EvioCompactStructureHandler(evioBuffer,DataType.BANK);
4949
eventNodes = structure.getChildNodes();
50-
} catch (EvioException ex) {
50+
} catch (EvioException | IndexOutOfBoundsException | NullPointerException ex) {
5151
Logger.getLogger(EvioDataEvent.class.getName()).log(Level.SEVERE, null, ex);
5252
}
5353
}

0 commit comments

Comments
 (0)