diff --git a/src/state_point.cpp b/src/state_point.cpp index 8ca0166c6..23538da59 100644 --- a/src/state_point.cpp +++ b/src/state_point.cpp @@ -403,10 +403,11 @@ void load_state_point() // Read batch number to restart at read_dataset(file_id, "current_batch", simulation::restart_batch); - if (simulation::restart_batch >= settings::n_batches) { - fatal_error(fmt::format("The number of batches specified for simiulation ({}) is smaller" - " than the number of batches in the restart statepoint file ({})", - settings::n_batches, simulation::restart_batch)); + if (simulation::restart_batch >= settings::n_max_batches) { + fatal_error(fmt::format( + "The number of batches specified for simiulation ({}) is smaller" + " than the number of batches in the restart statepoint file ({})", + settings::n_max_batches, simulation::restart_batch)); } // Logical flag for source present in statepoint file