fix(xo-server): fix cannot read properties of undefined (#10668)

Introduced by e58587aa1d
This commit is contained in:
Mathieu
2026-10-26 11:02:03 +01:00
committed by GitHub
parent d2ffe1ad56
commit 767fc2cb76
2 changed files with 6 additions and 1 deletions

View File

@@ -15,6 +15,8 @@
> Users must be able to say: "I had this issue, happy to know it's fixed"
- Fix `cannot read properties of undefined (reading code)` (PR [#10668](https://github.com/vatesfr/xen-orchestra/pull/10668))
### Packages to release
> When modifying a package, add it here with its release type.
@@ -31,4 +33,6 @@
<!--packages-start-->
- xo-server patch
<!--packages-end-->

View File

@@ -785,7 +785,8 @@ export default class XenServers {
const lastEventFetchedTimestamp = xapis[server.id]?.lastEventFetchedTimestamp
if (
lastEventFetchedTimestamp !== undefined &&
Date.now() > lastEventFetchedTimestamp + this._xapiMarkDisconnectedDelay
Date.now() > lastEventFetchedTimestamp + this._xapiMarkDisconnectedDelay &&
xapis[server.id].watchEventsError !== undefined
) {
server.error = serializeError(xapis[server.id].watchEventsError)
}