From fd7267bc010be8a1cf136e171b022cf5af2140f9 Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Tue, 18 May 2021 11:33:48 +0300 Subject: [PATCH] Add npe check --- src/components/fullcalendar/FullCalendar.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/fullcalendar/FullCalendar.vue b/src/components/fullcalendar/FullCalendar.vue index 8ffa3e09f..a72fd463d 100755 --- a/src/components/fullcalendar/FullCalendar.vue +++ b/src/components/fullcalendar/FullCalendar.vue @@ -14,8 +14,10 @@ export default { calendar: null, watch: { events(value) { - this.calendar.removeAllEventSources(); - this.calendar.addEventSource(value); + if (value && this.calendar) { + this.calendar.removeAllEventSources(); + this.calendar.addEventSource(value); + } }, options(value) { if (value && this.calendar) { @@ -31,6 +33,7 @@ export default { } }, updated() { + console.log('updated'); if (!this.calendar && this.$el.offsetParent) { this.initialize(); }