Add check for 0 samples, which means we would try to dereference an iterator which doesn't point to a sample.
Add check for 0 samples, which means we would try to dereference an iterator which doesn't point to a sample.

bgrimstad/splinter,bgrimstad/splinter,ds283/splinter,ds283/splinter,bgrimstad/splinter,ds283/splinter,ds283/splinter,bgrimstad/splinter,ds283/splinter,bgrimstad/splinter