diff --git a/.changelog/20383.txt b/.changelog/20383.txt new file mode 100644 index 000000000..c7cb8cc54 --- /dev/null +++ b/.changelog/20383.txt @@ -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 +``` diff --git a/ui/app/models/allocation.js b/ui/app/models/allocation.js index 69aba4824..4d83507a6 100644 --- a/ui/app/models/allocation.js +++ b/ui/app/models/allocation.js @@ -81,9 +81,9 @@ export default class Allocation extends Model { get hasBeenRestarted() { return this.states - .map((s) => s.events.content) + .map((s) => s.events?.content) .flat() - .find((e) => e.type === 'Restarting'); + .find((e) => e?.type === 'Restarting'); } @attr healthChecks;