why if my json column is `null` i get a type error...
# help
d
why if my json column is
null
i get a type error on the frontend?
i have a json column and the row value should be an array of objects
if the value is
null
i get a type error on the frontend
"cannot read properties of null (reading 'length')"
this is the structure of the array when i query
Copy code
json
[
  {
    name: 'Client Name'
    address: [{Object}]
    email: 'Client Email'
    open_jobs: null
  }
]
the error occurs when i iterate over the array
if i set the row value to an empty array instead of
null
the code works perfectly
r
How did you set the default value of array to empty ? I am trying but its not working.