Skip to content

Commit

Permalink
check null #135
Browse files Browse the repository at this point in the history
  • Loading branch information
walterxie committed May 6, 2024
1 parent 2352d6f commit 1063e71
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lphybeast/src/main/java/lphybeast/BEASTContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -779,11 +779,12 @@ private BEASTInterface valueToBEAST(Value<?> val) {
private boolean isExcludedValue(Value value) {
if (LPhyBEASTExt.isExcludedValue(value)) // takes Value
return true;
for (Class vCls : excludedValueTypes)
for (Class vCls : excludedValueTypes) {
// compare the wrapped value's class.
// if vCls is either the same as, or is a superclass or superinterface of value.getType().
if (vCls.isAssignableFrom(value.getType()))
if (vCls != null && vCls.isAssignableFrom(value.getType()))
return true;
}
return false;
}

Expand Down

0 comments on commit 1063e71

Please sign in to comment.