From 100cce95a192cf6e8d4788059bf8317cdabbfeb6 Mon Sep 17 00:00:00 2001 From: Daniel Dietrich Date: Mon, 26 Sep 2016 00:13:35 +0200 Subject: [PATCH] NullPointer Exception could occur on equals call. --- javaslang/src/main/java/javaslang/collection/List.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javaslang/src/main/java/javaslang/collection/List.java b/javaslang/src/main/java/javaslang/collection/List.java index dc22c7ca53..ce5b37a18a 100644 --- a/javaslang/src/main/java/javaslang/collection/List.java +++ b/javaslang/src/main/java/javaslang/collection/List.java @@ -1039,7 +1039,7 @@ default List remove(T element) { boolean found = false; while (!found && !result.isEmpty()) { final T head = result.head(); - if (head.equals(element)) { + if (Objects.equals(head, element)) { found = true; } else { preceding.addFirst(head);