From 1063e71f0e5940c62681baeea127bd16c68ade53 Mon Sep 17 00:00:00 2001 From: Walter Date: Tue, 7 May 2024 11:35:12 +1200 Subject: [PATCH] check null #135 --- lphybeast/src/main/java/lphybeast/BEASTContext.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lphybeast/src/main/java/lphybeast/BEASTContext.java b/lphybeast/src/main/java/lphybeast/BEASTContext.java index c52d4e5..7ae6fd1 100644 --- a/lphybeast/src/main/java/lphybeast/BEASTContext.java +++ b/lphybeast/src/main/java/lphybeast/BEASTContext.java @@ -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; }