adriankumpf / findmeaflat

Get notified of new listings on popular German real estate portals.
22 stars 6 forks source link

ebay kleinanzeigen fails with undefined error #4

Closed chbndrhnns closed 5 years ago

chbndrhnns commented 5 years ago

When I have a search for ebay kleinanzeigen, the scraper fails with

TypeError: Cannot read property 'join' of undefined
    at Object.isOneOf (/app/lib/utils.js:2:42)
    at applyBlacklist (/app/lib/sources/kleinanzeigen.js:13:32)
    at Array.filter (<anonymous>)
    at FlatFinder.run (/app/lib/flatfinder.js:21:8)
    at process._tickCallback (internal/process/next_tick.js:68:7)

If I add this lines to utils.js it seems to work:

function isOneOf(word, arr) {
  if (arr === undefined) {
    return true
  }
adriankumpf commented 5 years ago

It looks like this happens when there is no blacklist present in the config.json. I just pushed a fix. Thanks for reporting!

chbndrhnns commented 5 years ago

Thanks, it works now here!