From 28b2eff77daa67d2a60537370fdcd1823a105713 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 8 Sep 2011 13:05:29 -0400 Subject: [PATCH] Fixed segmentation fault when forgetting to specify material on cell. Closes gh-34. --- src/input_xml.f90 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/input_xml.f90 b/src/input_xml.f90 index b5e0553cd4..459a6c90e1 100644 --- a/src/input_xml.f90 +++ b/src/input_xml.f90 @@ -132,6 +132,13 @@ contains c % material = cell_(i) % material c % fill = cell_(i) % fill + ! Check to make sure that either material or fill was specified + if (c % material == 0 .and. c % fill == 0) then + msg = "Neither material nor fill was specified for cell " // & + trim(int_to_str(c % uid)) + call fatal_error(msg) + end if + ! Check to make sure that both material and fill haven't been ! specified simultaneously if (c % material /= 0 .and. c % fill /= 0) then