mirror of
https://github.com/Sebclem/hassio-nextcloud-backup.git
synced 2024-11-22 01:02:59 +01:00
🚑 Fix crash if next_backup is empty (if auto backup not configured) #84
This commit is contained in:
parent
cf98379de9
commit
7b7d5a2b0e
@ -77,7 +77,7 @@ class CronContainer {
|
||||
|
||||
updateNextDate() {
|
||||
let date;
|
||||
if (this.cronJob == null) date = "Not configured";
|
||||
if (this.cronJob == null) date = null;
|
||||
else date = this.cronJob.nextDate().format("MMM D, YYYY HH:mm");
|
||||
let status = statusTools.getStatus();
|
||||
status.next_backup = date;
|
||||
|
@ -550,8 +550,8 @@ function publish_state(state){
|
||||
error_code: state.error_code,
|
||||
message: state.message,
|
||||
icon: icon,
|
||||
last_backup: state.last_backup == null ? "" : new Date(state.last_backup).toISOString(),
|
||||
next_backup: state.next_backup == null ? "" : new Date(state.next_backup).toISOString()
|
||||
last_backup: state.last_backup == null || state.last_backup == "" ? "" : new Date(state.last_backup).toISOString(),
|
||||
next_backup: state.next_backup == null || state.next_backup == "" ? "" : new Date(state.next_backup).toISOString()
|
||||
},
|
||||
}
|
||||
option.json = data_state_sensor
|
||||
|
Loading…
Reference in New Issue
Block a user