cubehouse / themeparks

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

Receiving error "Cannot read property 'date' of undefined #256

Open fischgeek opened 5 years ago

fischgeek commented 5 years ago

Park WDW Florida

Context

How to find your themeparks version: Installed latest with npm | npm list | find "themeparks"

Describe the bug Running into an issue where the date roll-over might be the culprit. I was going smooth until the parks time of day rolled over to the next day (12:00am) and I was still on the previous day (1hr timezone difference). All calls failed on line 96 of disneyworldapibase.js.

cubehouse commented 5 years ago

Can you share a little about your setup? Are you keeping the NodeJS process running between requests and making sure the database cache file isn't deleted each time an update it requested?

fischgeek commented 5 years ago

Sure. I don't keep the NodeJS process running. I run a script on demand and the database is not deleted each time. I can tell because when it pulls from cache it's faster.

Again, this only seems to happen at night when the park hours have rolled over to the next day and I'm still on the previous day. I will try again tonight and update you if so.

fischgeek commented 5 years ago

Crap. Fell asleep. Maybe if we just put a bail out in there if GetCurrentParkSchedule() returns null?