From eb2e08da3fd65ed22f19ce3b6a01e83f95645857 Mon Sep 17 00:00:00 2001 From: Steve Hannah Date: Fri, 5 Feb 2016 15:02:41 -0800 Subject: [PATCH] Fixed NPE in LinkedList.remove(e) --- .../main/java/org/teavm/classlib/java/util/TLinkedList.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classlib/src/main/java/org/teavm/classlib/java/util/TLinkedList.java b/classlib/src/main/java/org/teavm/classlib/java/util/TLinkedList.java index ff98a6b97..d91237ac4 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/util/TLinkedList.java +++ b/classlib/src/main/java/org/teavm/classlib/java/util/TLinkedList.java @@ -343,10 +343,10 @@ public class TLinkedList extends TAbstractSequentialList implements TDeque } removeEntry(currentEntry); if (currentEntry == prevEntry) { - prevEntry = nextEntry.previous; + prevEntry = hasNext() ? nextEntry.previous : null; --index; } else if (currentEntry == nextEntry) { - nextEntry = prevEntry.next; + nextEntry = hasPrevious() ? prevEntry.next : null; } --size; version = modCount;