Fixes unhandled exception while reading nonexistent file on Node.js

Hi, I am using text in a module that is executed on both browser and Node.js environments and I found this issue while running some negative tests.