Skip to content

Commit ef7684e

Browse files
committed
Return a default range if the values array is empty.
Instead of crashing...
1 parent 6425663 commit ef7684e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/main/java/fiji/plugin/trackmate/util/TMUtils.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,9 @@ public static final double getPercentile( final double[] values, final double p
313313
*/
314314
private static final double[] getRange( final double[] data )
315315
{
316+
if ( data.length == 0 )
317+
return new double[] { 1., 0., 1. };
318+
316319
final double min = Arrays.stream( data ).min().getAsDouble();
317320
final double max = Arrays.stream( data ).max().getAsDouble();
318321
return new double[] { ( max - min ), min, max };

0 commit comments

Comments
 (0)