Skip to content

Commit

Permalink
CZI: prevent AIOOB exception when populating position metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
melissalinkert committed Jun 9, 2014
1 parent 06a453b commit 8b5a2bc
Showing 1 changed file with 6 additions and 3 deletions.
Expand Up @@ -2187,9 +2187,12 @@ private void translateExperiment(Element root) throws FormatException {
String y = getFirstNode(region, "Y").getTextContent();
String z = getFirstNode(region, "Z").getTextContent();

positionsX[i] = x == null ? null : new Double(x);
positionsY[i] = y == null ? null : new Double(y);
positionsZ[i] = z == null ? null : new Double(z);
// safe to assume all 3 arrays have the same length
if (i < positionsX.length) {
positionsX[i] = x == null ? null : new Double(x);
positionsY[i] = y == null ? null : new Double(y);
positionsZ[i] = z == null ? null : new Double(z);
}
}
}
}
Expand Down

0 comments on commit 8b5a2bc

Please sign in to comment.