Skip to content

Commit

Permalink
Sampling no longer fails on empty compartments.
Browse files Browse the repository at this point in the history
  • Loading branch information
tgvaughan committed Jun 22, 2016
1 parent 8e1b8b3 commit ed923fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/master/postprocessors/LineageSampler.java
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ private static void collectNodes(Node node, double samplingTime,
*/
private static List<Node> getSampledLineages(List<Node> nodesToSample, int nSamples) {
List<Node> sampledNodes = Lists.newArrayList();
while (nSamples > 0 && !nodesToSample.isEmpty()) {
while (nSamples > 0 && nodesToSample != null && !nodesToSample.isEmpty()) {
int index = Randomizer.nextInt(nodesToSample.size());
Node sampledNode = nodesToSample.remove(index);
sampledNodes.add(sampledNode);
Expand Down

0 comments on commit ed923fc

Please sign in to comment.