diff --git a/src/cross_sections.cpp b/src/cross_sections.cpp index a7bd86095b..248ae9019d 100644 --- a/src/cross_sections.cpp +++ b/src/cross_sections.cpp @@ -283,6 +283,10 @@ void read_ce_cross_sections_xml() { // Check if cross_sections.xml exists const auto& filename = settings::path_cross_sections; + if (dir_exists(filename)) { + fatal_error("OPENMC_CROSS_SECTIONS is set to a directory. " + "It should be set to an XML file."); + } if (!file_exists(filename)) { // Could not find cross_sections.xml file fatal_error("Cross sections XML file '" + filename + "' does not exist.");