sideshowcoder / canned

Server to respond with fake API responses, by using a directory of files for finding out what to say!
213 stars 46 forks source link

Crash if you rename folder #5

Closed leifg closed 11 years ago

leifg commented 11 years ago

If you rename/delete a folder and make a request to the old location, the following error appears:

/usr/local/share/npm/lib/node_modules/canned/canned.js:19
  for (i = 0, e = files[i]; e != null; e = files[++i]) {
                   ^
TypeError: Cannot read property '0' of undefined
    at scanFileListForName (/usr/local/share/npm/lib/node_modules/canned/canned.js:19:24)
    at responseForFile (/usr/local/share/npm/lib/node_modules/canned/canned.js:54:10)
    at /usr/local/share/npm/lib/node_modules/canned/canned.js:103:9    at Object.oncomplete (fs.js:107:15)