From e9336b89730fd876e88de67e63850c0d231166bf Mon Sep 17 00:00:00 2001 From: Richard Domander Date: Fri, 8 Jun 2018 16:22:28 +0100 Subject: [PATCH] Fix ArrayIndexOutOfBounds exception Fixes a bug that was caused by a zero length array. Apparently it was me who introduced this bug earlier. Mea culpa. --- src/main/java/sc/fiji/pQCT/analysis/SoftTissueAnalysis.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/sc/fiji/pQCT/analysis/SoftTissueAnalysis.java b/src/main/java/sc/fiji/pQCT/analysis/SoftTissueAnalysis.java index c5349ab..98cbcc4 100644 --- a/src/main/java/sc/fiji/pQCT/analysis/SoftTissueAnalysis.java +++ b/src/main/java/sc/fiji/pQCT/analysis/SoftTissueAnalysis.java @@ -146,7 +146,7 @@ public SoftTissueAnalysis(final SelectSoftROI roi) { // TODO Use a pre-existing method private static double median(final double[] a) { - if (a.length < 0) { + if (a.length == 0) { return 0.0; } if (a.length == 1) {