diff options
author | Rex Kerr <ichoran@gmail.com> | 2013-12-23 17:32:20 -0800 |
---|---|---|
committer | Rex Kerr <ichoran@gmail.com> | 2013-12-31 11:50:46 -0800 |
commit | ad594604ed3a91371ba99a4fb9e8ce7f87f4635b (patch) | |
tree | 727632d09f2f30695466021b2e255323302ddabb | |
parent | b2bf66a4681dec76281da9469e66e0100ad2709f (diff) | |
download | scala-ad594604ed3a91371ba99a4fb9e8ce7f87f4635b.tar.gz scala-ad594604ed3a91371ba99a4fb9e8ce7f87f4635b.tar.bz2 scala-ad594604ed3a91371ba99a4fb9e8ce7f87f4635b.zip |
SI-6615 PagedSeq's slice throws a NPE if it starts on a page that hasn't been computed yet
Made sure to addMore when roving forward on a slice into unpaged territory.
-rw-r--r-- | src/library/scala/collection/immutable/PagedSeq.scala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/library/scala/collection/immutable/PagedSeq.scala b/src/library/scala/collection/immutable/PagedSeq.scala index 589661a343..3a64820be6 100644 --- a/src/library/scala/collection/immutable/PagedSeq.scala +++ b/src/library/scala/collection/immutable/PagedSeq.scala @@ -188,7 +188,10 @@ extends scala.collection.AbstractSeq[T] val s = start + _start val e = if (_end == UndeterminedEnd) _end else start + _end var f = first1 - while (f.end <= s && !f.isLast) f = f.next + while (f.end <= s && !f.isLast) { + if (f.next eq null) f.addMore(more) + f = f.next + } new PagedSeq(more, f, s, e) } |