adding first item to the list returning an undefined index
pYr0x opened this issue · comments
Julian commented
hey guys
i found a bug in can-query-logic with realtimeRestModel.
if a have an empty list and i will add the first item to it, by saving it, i hit this line:
https://github.com/canjs/can-query-logic/blob/master/src/helpers.js#L105
but with an empty list the first index should be 0
and not undefined
. so i wondering why you checked for !items.length
because items.length
with 0
is true
.
Example:
https://codepen.io/pYr0x/pen/mdwOQyo