Update ftp.js

Added undefined check to readdir~getNext()