Skip to content

Calendar Hud Attempts to update the clock UI whenever time changes #6496

Description

@xthesaintx

Calendar Hud Attempts to update the clock UI whenever time changes, but it forgets to check if the UI actually exists (is enabled/rendered) first. Because the UI element is missing, this.element.querySelector crashes.

with the hud disabled and I change the time I get:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'querySelector')
at CalendarHUD.renderCore (calendar-hud.mjs:214:18)
at CalendarHUD.onUpdateWorldTime (calendar-hud.mjs:305:24)

this.element.querySelector(".calendar-date").innerText = dateFormatter ? game.time.calendar.format(

static onUpdateWorldTime(worldTime, deltaTime, options, userId) {
dnd5e.ui.calendar?.renderCore(options.dnd5e?.deltas);
}

Metadata

Metadata

Assignees

Labels

system: calendarCalendar HUD and integration with core calendar system

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions