From 6a7e36ce90281b4975c0d3cdf98cec801867c520 Mon Sep 17 00:00:00 2001 From: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk> Date: Sat, 27 Jan 2024 19:14:13 +0000 Subject: [PATCH] More robust finding of has_values --- src/building_blocks.jl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/building_blocks.jl b/src/building_blocks.jl index ba927b0..5d932fe 100644 --- a/src/building_blocks.jl +++ b/src/building_blocks.jl @@ -202,8 +202,16 @@ function owner_model(bb::BuildingBlock) end end end - error("Cannot find owner model of $bb") + error("Cannot find owner model") +end + +function has_values(bb::BuildingBlock) + try + return has_values(owner_model(bb)) + catch + # return true for building blocks without a model + return true + end end -has_values(bb::BuildingBlock) = has_values(owner_model(bb)) end \ No newline at end of file -- GitLab