diff --git a/src/base/ctexceptions.cpp b/src/base/ctexceptions.cpp index 7f1b610dc..118f8e173 100644 --- a/src/base/ctexceptions.cpp +++ b/src/base/ctexceptions.cpp @@ -72,6 +72,9 @@ string ArraySizeError::getMessage() const string IndexError::getMessage() const { + if (arrayName_ == "") { + return fmt::format("IndexError: {} outside valid range of 0 to {}.", m_, mmax_); + } return fmt::format("IndexError: {}[{}] outside valid range of 0 to {}.", arrayName_, m_, mmax_); }