Closed unsusp-spec closed 3 years ago
Hi,
when I try to run the bot, I get the error
Caught Error: TypeError: Cannot read property 'split' of undefined at normalize (~/findmeaflat/lib/sources/kleinanzeigen.js:7:21) at Array.map (<anonymous>) at FlatFinder.run (~/findmeaflat/lib/flatfinder.js:22:8) at runMicrotasks (<anonymous>) at processTicksAndRejections (node:internal/process/task_queues:94:5) at async Promise.all (index 3) { [stack]: "TypeError: Cannot read property 'split' of undefined\n" + ' at normalize (~/findmeaflat/lib/sources/kleinanzeigen.js:7:21)\n' + ' at Array.map (<anonymous>)\n' + ' at FlatFinder.run (~/findmeaflat/lib/flatfinder.js:22:8)\n' + ' at runMicrotasks (<anonymous>)\n' + ' at processTicksAndRejections (node:internal/process/task_queues:94:5)\n' + ' at async Promise.all (index 3)', [message]: "Cannot read property 'split' of undefined"
However, if I replace the line const address = o.address.split('\n')[4].trim()
const address = o.address.split('\n')[4].trim()
in lib/sources/kleinanzeigen.js by
const address = o.address
the bot works fine.
Cheers!
Good catch, @unsusp-spec! I will take a look at it when I have time. Feel free to create a PR with the fix in the meantime :)
PR #22 should solve this.
Addressed again in PR #25
Fixed by #25
Hi,
when I try to run the bot, I get the error
However, if I replace the line
const address = o.address.split('\n')[4].trim()
in lib/sources/kleinanzeigen.js by
const address = o.address
the bot works fine.
Cheers!