cozy / cozy-calendar

An application to manage your events
https://demo.cozycloud.cc/#apps/calendar/
GNU Affero General Public License v3.0
66 stars 39 forks source link

Error on event creation when there's no calendar #611

Open clochix opened 7 years ago

clochix commented 7 years ago

After deleting all its calendars, a user is unable to create events. Creating a new calendar solves the issue. Here's the client side exception:

[2016-10-27 17:02:18:696] error - calendar:client | {"type":"error","error":{"msg":"Uncaught TypeError: Cannot read property 'get' of undefined","name":"TypeError","full":"TypeError: Cannot read property 'get' of undefined","stack":"TypeError: Cannot read property 'get' of undefined\n    at Event.module.exports.ScheduleItem.setCalendar (https://stentorignoze.cozycloud.cc/apps/calendar/javascripts/app.js:7282:23)\n    at MainPopoverScreen.module.exports.MainPopoverScreen.onAddClicked (https://stentorignoze.cozycloud.cc/apps/calendar/javascripts/app.js:10698:18)\n    at HTMLDivElement.dispatch (https://stentorignoze.cozycloud.cc/apps/calendar/javascripts/vendor.js:4523:9)\n    at HTMLDivElement.elemData.handle (https://stentorignoze.cozycloud.cc/apps/calendar/javascripts/vendor.js:4209:28)"},"url":"https://stentorignoze.cozycloud.cc/apps/calendar/javascripts/app.js","line":7282,"col":23,"href":"https://stentorignoze.cozycloud.cc/apps/calendar/#month/2016/10"}
[2016-10-27 17:02:18:696] error - calendar:client | TypeError: Cannot read property 'get' of undefined
    at Event.module.exports.ScheduleItem.setCalendar (https://stentorignoze.cozycloud.cc/apps/calendar/javascripts/app.js:7282:23)
    at MainPopoverScreen.module.exports.MainPopoverScreen.onAddClicked (https://stentorignoze.cozycloud.cc/apps/calendar/javascripts/app.js:10698:18)
    at HTMLDivElement.dispatch (https://stentorignoze.cozycloud.cc/apps/calendar/javascripts/vendor.js:4523:9)
    at HTMLDivElement.elemData.handle (https://stentorignoze.cozycloud.cc/apps/calendar/javascripts/vendor.js:4209:28)
jsilvestre commented 7 years ago

Thank you for the report!