Skip to content

Instantly share code, notes, and snippets.

@schamane
Created February 1, 2011 17:04
Show Gist options
  • Save schamane/806161 to your computer and use it in GitHub Desktop.
Save schamane/806161 to your computer and use it in GitHub Desktop.
Fix if file was not readed
diff --git a/bin/uglifyjs b/bin/uglifyjs
index ad3866f..02f0268 100755
--- a/bin/uglifyjs
+++ b/bin/uglifyjs
@@ -105,7 +105,11 @@ out: while (args.length > 0) {
if (filename) {
fs.readFile(filename, "utf8", function(err, text){
- output(squeeze_it(text));
+ if(err) {
+ sys.debug(err);
+ } else {
+ output(squeeze_it(text));
+ }
});
} else {
var stdin = process.openStdin();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment