You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by je...@apache.org on 2006/09/18 10:02:23 UTC

svn commit: r447314 - /xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/internal/TIFFImageWriter.java

Author: jeremias
Date: Mon Sep 18 01:02:23 2006
New Revision: 447314

URL: http://svn.apache.org/viewvc?view=rev&rev=447314
Log:
Avoid an NPE in close() when there is something going wrong in the writeImage() call before (and close() being called in a finally section).

Modified:
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/internal/TIFFImageWriter.java

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/internal/TIFFImageWriter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/internal/TIFFImageWriter.java?view=diff&rev=447314&r1=447313&r2=447314
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/internal/TIFFImageWriter.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/internal/TIFFImageWriter.java Mon Sep 18 01:02:23 2006
@@ -139,7 +139,9 @@
         }
         
         public void close() throws IOException {
-            encoder.finishMultiple(context);
+            if (encoder != null) {
+                encoder.finishMultiple(context);
+            }
             encoder = null;
             encodeParams = null;
             out.flush();



---------------------------------------------------------------------
Apache XML Graphics Project URL: http://xmlgraphics.apache.org/
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org