From 2ace13378cc532a96ef2e9912256f5cf38154135 Mon Sep 17 00:00:00 2001 From: Yue JIN Date: Thu, 3 Sep 2020 11:09:02 +0800 Subject: [PATCH] Examine if the region exists before removing redundant surfaces --- openmc/geometry.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openmc/geometry.py b/openmc/geometry.py index 3becde9a7a..e7d981d7b8 100644 --- a/openmc/geometry.py +++ b/openmc/geometry.py @@ -568,7 +568,8 @@ class Geometry: # Iterate through all cells contained in the geometry for cell in self.get_all_cells().values(): # Recursively remove redundant surfaces from regions - cell.region.remove_redundant_surfaces(redundant_surfaces) + if cell.region: + cell.region.remove_redundant_surfaces(redundant_surfaces) def determine_paths(self, instances_only=False): """Determine paths through CSG tree for cells and materials.