xmlgraphics-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerem...@apache.org
Subject svn commit: r447314 - /xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/internal/TIFFImageWriter.java
Date Mon, 18 Sep 2006 08:02:23 GMT
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


Mime
View raw message