Skip to content

Commit af3da9a

Browse files
committed
improve error message
1 parent 6036b94 commit af3da9a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/beast/gss/NS.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ public void initAndValidate() {
148148
"Expected only one likelihood distribution -- change the ID to something that does not start with likelihood and it will be deemed to be a prior.");
149149
}
150150
} else {
151+
if (nextPriorIndex == samplingDistribution.length) {
152+
throw new IllegalArgumentException(
153+
"Nested sampling needs distribution with id='likelihood' representing the likelihood, but could not find one.");
154+
}
151155
samplingDistribution[nextPriorIndex] = pDist;
152156
nextPriorIndex++;
153157
}

0 commit comments

Comments
 (0)