QTree with children as object triggers error since 2.12 #15991
Labels
area/components
bug/1-repro-available
A reproduction is available and needs to be confirmed.
flavour/quasar-cli-webpack
kind/bug 🐞
Qv2 🔝
Quasar v2 issues
What happened?
Since 2.12.0, specifically this commit c6242ba#diff-387b9b62424fed6c9add037b377c07e02f3deca0d50edeb2a415defd12f0e9bbR143
A QTree throws error when nodes have an empty object instead of an empty array
This is a problem because in PHP json serialization creates objects instead of arrays when your array is empty, which when retrieved from API and used in Quasar, triggers this error
What did you expect to happen?
No error to be thrown, it should handle the fact that children is not an array
Reproduction URL
https://codepen.io/Tofandel/pen/RwqRwQY
How to reproduce?
Flavour
Quasar CLI with Webpack (@quasar/cli | @quasar/app-webpack)
Additional context
Changing from
.length > 0
to.length !== 0
is not equivalent because({}).length
isundefined
The text was updated successfully, but these errors were encountered: