Permalink
Browse files

My changes to use a ByteArrayOutputStream would cause a NullPointerEx…

…ception if you didn't specify an output file.

This fixes that, yikes.
  • Loading branch information...
1 parent 4c60b2d commit fc5d01e5ea3372aec40f1b563215d43c72e694dc @tivac tivac committed Apr 19, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/net/nczonline/web/cssembed/CSSEmbed.java
@@ -183,7 +183,10 @@ public static void main(String[] args) {
if (out != null) {
try {
out.close();
- bytes.writeTo(new FileOutputStream(outputFilename));
+
+ if(bytes.size() > 0) {
+ bytes.writeTo(new FileOutputStream(outputFilename));
+ }
} catch (IOException e) {
System.err.println("[ERROR] " + e.getMessage());
if (verbose){

0 comments on commit fc5d01e

Please sign in to comment.