(node:55028) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined at /Users/patrickstanciu/WebstormProjects/autismassistant/backend/api/controllers/paymentsController.js:1045:34
at processTicksAndRejections (internal/process/task_queues.js:94:5) (node:55028) UnhandledPromiseRejectionWarning: Unhandled promise rejection.
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:55028) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I have this error in my node.js backend when I try to login with an user. Why does it appear? Here is the line:
if (!profilePromise.rows.length) {
resolve({
success: true,
cardDetails: null,
planId: null
})
return;
}
I have problems with "length" above