I'm pretty sure lstat can throw.  I'd recommend you put these fs checks in a function that wraps these checks in a try/catch.