the hasBeenRestarted allocation property checks against its task events, which can sometimes be null (#20383)

This commit is contained in:
Phil Renaud
2024-04-12 14:49:07 -04:00
committed by GitHub
parent 43281f6038
commit f9c4d2bdf0
2 changed files with 5 additions and 2 deletions

3
.changelog/20383.txt Normal file
View File

@@ -0,0 +1,3 @@
```release-note:bug
ui: Fix an issue where the job status box would error if an allocation had no task events
```

View File

@@ -81,9 +81,9 @@ export default class Allocation extends Model {
get hasBeenRestarted() { get hasBeenRestarted() {
return this.states return this.states
.map((s) => s.events.content) .map((s) => s.events?.content)
.flat() .flat()
.find((e) => e.type === 'Restarting'); .find((e) => e?.type === 'Restarting');
} }
@attr healthChecks; @attr healthChecks;