How to return a null doc after query call
Closed this issue · 1 comments
ErnestDaDev commented
i am trying to get a doc with code below,
final doc = await _col.findOne(
filter: {
"email": email,
});
but when the doc does not exist, it does not give a null doc but returns an error which says
NoSuchMethodError: The getter 'length' was called on null.
How do i handle such errors?
Thanks!
kfiross commented
Thanks for the PR!