Skip to content

JSON variables with null in ther value, returns pre-request script error #10248

Description

@Ilie-c

Expected Behavior

Json variable is accepted and it can be used in request and scripts.

Actual Behavior

Variables block returns error that it cannot convert undefined or null to object.

Image

Reproduction Steps

  1. Set Json view in Collection Variable view.
  2. Create a json variable in global variable or environment variables
  3. Add one of it's parameter to have "null" as value
  4. send request

Is there an existing issue for this?

Which sync method do you use?

  • Git sync.
  • Insomnia Cloud sync.
  • Local only

Additional Information

There is a workaround so that insomnia will not auto fix the json and that is to switch from json view to table view, but the error will still persist in the request.
Used overall object looks like :

{
   "test":{
      "param1":null
   },
   "test2":{
      "param1":"string"
   }
}

Insomnia Version

13.0.2

What operating system are you using?

Windows

Operating System Version

11 ver 24h2

Installation method

download from git release

Last Known Working Insomnia version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-bugBug: general classificationS-verifiedStatus: Verified by maintainer

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions