Fixed NPE in LinkedList.remove(e)

This commit is contained in:
Steve Hannah 2016-02-05 15:02:41 -08:00
parent f2fb5c7bd7
commit eb2e08da3f

View File

@ -343,10 +343,10 @@ public class TLinkedList<E> extends TAbstractSequentialList<E> 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;