Permalink
Browse files

SI-6615 PagedSeq's slice throws a NPE if it starts on a page that has…

…n't been computed yet

Made sure to addMore when roving forward on a slice into unpaged territory.
  • Loading branch information...
1 parent b2bf66a commit ad594604ed3a91371ba99a4fb9e8ce7f87f4635b @Ichoran Ichoran committed Dec 24, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 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)
}

0 comments on commit ad59460

Please sign in to comment.