cubehouse / themeparks

Unofficial API for accessing ride wait times and schedules for Disneyland, Disney World, Universal Studios, and many more parks
MIT License
536 stars 126 forks source link

Fix "Cannot read property 'date' of null" errors w/ GetOpeningTimes #332

Closed oonqt closed 3 years ago

oonqt commented 3 years ago

When using the GetOpeningTimes method, there is a chance that the calendar endpoint will give us back a value of null for certain days, so during each iteration we check that the date actually exists, if not, we skip over it.

The pattern I am seeing that any dates before the current (todays) date are marked as null in the calendar endpoint, only future dates are displayed.

cubehouse commented 3 years ago

Hi, thanks for your pull request.

I can't find any URLs with this behaviour, but I have made a safety fix in the backend anyway. Can you let me know if you see examples of this behaviour with the park/URL that is doing it? If you do see this, please reopen this pull request and have a look at fixing the merge errors.

Thanks :)

oonqt commented 3 years ago

I’m can’t remember for sure, but it was either DisneylandResortCaliforniaAdventure or DisneylandResortMagicKingdom that resulted in this error.