fix(common): handle null request ref in InspectionService for test-runner tabs (#5814)

Co-authored-by: James George <25279263+jamesgeorge007@users.noreply.github.com>
This commit is contained in:
Leonic 2026-01-29 18:39:34 +01:00 committed by GitHub
parent 645ecb55d8
commit fbe0b8fd10
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -181,11 +181,18 @@ export class InspectionService extends Service {
maxWait: 2000,
})
const inspectorRefs = computed(() =>
Array.from(this.inspectors.values()).map((x) =>
x.getInspections(debouncedReq, debouncedRes)
const inspectorRefs = computed(() => {
if (debouncedReq.value === null) return []
return Array.from(this.inspectors.values()).map((inspector) =>
inspector.getInspections(
debouncedReq as Readonly<
Ref<HoppRESTRequest | HoppRESTResponseOriginalRequest>
>,
debouncedRes
)
)
)
})
const activeInspections = computed(() =>
inspectorRefs.value.flatMap((x) => x?.value ?? [])