This commit is contained in:
Kerwin 2022-06-22 09:09:20 +08:00 committed by GitHub
parent 8edaa6a7de
commit 2c4473ee43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -127,7 +127,7 @@ public class CronUtils {
while (Stopper.isRunning()) {
startTime = cronExpression.getNextValidTimeAfter(startTime);
if (startTime.after(endTime)) {
if (startTime == null || startTime.after(endTime)) {
break;
}
dateList.add(startTime);
@ -149,7 +149,7 @@ public class CronUtils {
List<Date> dateList = new ArrayList<>();
while (fireTimes > 0) {
startTime = cronExpression.getNextValidTimeAfter(startTime);
if (startTime.after(endTime) || startTime.equals(endTime)) {
if (startTime == null || startTime.after(endTime) || startTime.equals(endTime)) {
break;
}
dateList.add(startTime);
@ -172,7 +172,7 @@ public class CronUtils {
while (Stopper.isRunning()) {
startTime = cronExpression.getNextValidTimeAfter(startTime);
if (startTime.after(endTime) || startTime.equals(endTime)) {
if (startTime == null || startTime.after(endTime) || startTime.equals(endTime)) {
break;
}
dateList.add(startTime);