Web: extra safety check in Jobs Pinia store function

This commit is contained in:
Sybren A. Stüvel 2022-05-11 15:00:25 +02:00
parent d2f5fa5ca7
commit 6b9d7dba6d

View File

@ -68,7 +68,7 @@ export const useJobs = defineStore('jobs', {
* @returns bool indicating whether there is a selected job with any of the given statuses.
*/
_anyJobWithStatus(statuses) {
return !!this.activeJob && statuses.includes(this.activeJob.status);
return !!this.activeJob && !!this.activeJob.status && statuses.includes(this.activeJob.status);
// return this.selectedJobs.reduce((foundJob, job) => (foundJob || statuses.includes(job.status)), false);
},