Skip to content

LabeledValue is throwing for a null value #5001

Closed as not planned
Closed as not planned
@elodierafali

Description

@elodierafali

Provide a general summary of the issue here

<LabeledValue value={null} /> is throwing this error:

TypeError: Cannot use 'in' operator to search for 'start' in null
 at $3e9971be431adb24$var$LabeledValue (LabeledValue.tsx:85:1)

🤔 Expected Behavior?

<LabeledValue value={null} /> should not throw

😯 Current Behavior

The app page crashes

💁 Possible Solution

In the code do not use typeof value === 'object' because it's true for null or verify value is not null.

🔦 Context

We use LabeledValue with values that can be set to null by our third party form engine so it's difficult to make an exception just for this case to have the form engine not set null values when there is no value.

🖥️ Steps to Reproduce

Try <LabeledValue value={null} />

Version

3.22.0

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

MacOS Monterey

🧢 Your Company/Team

Adobe Journey Optimizer

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions