mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-05-23 23:32:34 +02:00
Fixed bug in maintenance.js
Added additional check in the model of maintenance.js to avoid an exception when recieving a payload without a date range.
This commit is contained in:
parent
9857770cc7
commit
89376b7b7c
1 changed files with 12 additions and 10 deletions
|
@ -157,6 +157,7 @@ class Maintenance extends BeanModel {
|
|||
bean.timezone = obj.timezoneOption;
|
||||
bean.active = obj.active;
|
||||
|
||||
if (obj.dateRange){
|
||||
if (obj.dateRange[0]) {
|
||||
bean.start_date = obj.dateRange[0];
|
||||
} else {
|
||||
|
@ -168,6 +169,7 @@ class Maintenance extends BeanModel {
|
|||
} else {
|
||||
bean.end_date = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (bean.strategy === "cron") {
|
||||
bean.duration = obj.durationMinutes * 60;
|
||||
|
|
Loading…
Add table
Reference in a new issue