mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-04-11 10:52:20 +00: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,16 +157,18 @@ class Maintenance extends BeanModel {
|
|||
bean.timezone = obj.timezoneOption;
|
||||
bean.active = obj.active;
|
||||
|
||||
if (obj.dateRange[0]) {
|
||||
bean.start_date = obj.dateRange[0];
|
||||
} else {
|
||||
bean.start_date = null;
|
||||
}
|
||||
|
||||
if (obj.dateRange[1]) {
|
||||
bean.end_date = obj.dateRange[1];
|
||||
} else {
|
||||
bean.end_date = null;
|
||||
if (obj.dateRange){
|
||||
if (obj.dateRange[0]) {
|
||||
bean.start_date = obj.dateRange[0];
|
||||
} else {
|
||||
bean.start_date = null;
|
||||
}
|
||||
|
||||
if (obj.dateRange[1]) {
|
||||
bean.end_date = obj.dateRange[1];
|
||||
} else {
|
||||
bean.end_date = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (bean.strategy === "cron") {
|
||||
|
|
Loading…
Add table
Reference in a new issue