Skip to content

/mark unhandled error: "TypeError: Cannot read property 'id' of undefined" #575

@danoswaltCL

Description

@danoswaltCL

Describe the bug
Seeing this for markExperimentPoint sometimes in QA/Prod logs:

"TypeError: Cannot read property 'id' of undefined"

image

To Reproduce
I'm not sure, it's easy to see exactly where and why the error happens codewise, but I'm not sure how to reproduce or what it means if this is unexpectedly undefined.

if (experimentDecisionPoint.length) {
        let selectedExperimentDP = experimentDecisionPoint.filter( dp => dp.experiment.id === experimentId);
        const decisionPointId = selectedExperimentDP[0].id; //<---- oops, selectedExperimentDP can be undefined

Expected behavior
Handle the error w/o 500 internal error throw

Screenshots
image

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpriority: highHigh priority issue

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions