From 815cda5f2d4daff0c100f96f7fe69ee8d7e0ba20 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Thu, 22 Dec 2016 20:37:52 +0800 Subject: [PATCH] Add List.bounds() --- source/net/filebot/format/ExpressionFormatMethods.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/net/filebot/format/ExpressionFormatMethods.java b/source/net/filebot/format/ExpressionFormatMethods.java index ab07bb6b..5d66a36a 100644 --- a/source/net/filebot/format/ExpressionFormatMethods.java +++ b/source/net/filebot/format/ExpressionFormatMethods.java @@ -545,7 +545,7 @@ public class ExpressionFormatMethods { } public static List bounds(Iterable self) { - return asList(DefaultGroovyMethods.min(self), DefaultGroovyMethods.max(self)); + return Stream.of(DefaultGroovyMethods.min(self), DefaultGroovyMethods.max(self)).filter(Objects::nonNull).distinct().collect(toList()); } /**