I've came across a situation where we need to dereference a cursor to check if it's falsy because on a deeper level, a sub cursor is returning null and is being accessed by an index, so throws an error.
Normally this could be avoided by defaulting to an empty array, but because it's a sub-cursor, that's not really managable (the sub-cursor tree is big).
This could be avoided also by having a method on the cursor that could tell you if your data is falsy - but perhaps this should stay out of cursor? WDYT?
I've came across a situation where we need to dereference a cursor to check if it's falsy because on a deeper level, a sub cursor is returning null and is being accessed by an index, so throws an error.
Normally this could be avoided by defaulting to an empty array, but because it's a sub-cursor, that's not really managable (the sub-cursor tree is big).
This could be avoided also by having a method on the cursor that could tell you if your data is falsy - but perhaps this should stay out of cursor? WDYT?