Skip to content

Commit 2fdd216

Browse files
committed
Fix #11054 - Crash with schedule with missing day types
1 parent 8291e16 commit 2fdd216

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/EnergyPlus/ScheduleManager.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2511,6 +2511,10 @@ namespace Sched {
25112511

25122512
auto const *weekSched = this->weekScheds[thisDayOfYear];
25132513
auto const *daySched = (thisHolidayNum > 0) ? weekSched->dayScheds[thisHolidayNum] : weekSched->dayScheds[thisDayOfWeek];
2514+
if (daySched == nullptr) {
2515+
// We already warned in ProcessScheduleInput that there were missing days: Missing day types will have 0.0 as Schedule Values
2516+
return 0.0;
2517+
}
25142518

25152519
// If Unspecified or equal to zero, use NumOfTimeStepInHour, otherwise use supplied
25162520
if (ts <= 0) {

0 commit comments

Comments
 (0)