From e7bc9ba23c896f758c3a4139133cd58eb2b9c1f9 Mon Sep 17 00:00:00 2001 From: Youssef Badr <104090877+ybadr16@users.noreply.github.com> Date: Fri, 16 Aug 2024 00:56:22 +0300 Subject: [PATCH] Added error if cross sections path is a folder (#3115) --- src/cross_sections.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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.");