commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dam...@apache.org
Subject svn commit: r1331275 - /commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageMetadata.java
Date Fri, 27 Apr 2012 07:54:02 GMT
Author: damjan
Date: Fri Apr 27 07:54:02 2012
New Revision: 1331275

URL: http://svn.apache.org/viewvc?rev=1331275&view=rev
Log:
Stop JpegImageMetadata from throwing NPE if the exif field is null.
Jira issue key: SANSELAN-73
Submitted by: Piyush Kapoor <pkapoor at adobe dot com>


Modified:
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageMetadata.java

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageMetadata.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageMetadata.java?rev=1331275&r1=1331274&r2=1331275&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageMetadata.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageMetadata.java
Fri Apr 27 07:54:02 2012
@@ -55,7 +55,11 @@ public class JpegImageMetadata implement
 
     public TiffField findEXIFValue(TagInfo tagInfo) {
         try {
-            return exif.findField(tagInfo);
+            if (exif != null) {
+               return exif.findField(tagInfo);
+            } else {
+               return null;
+            }
         } catch (ImageReadException cannotHappen) {
             return null;
         }
@@ -217,4 +221,4 @@ public class JpegImageMetadata implement
         Debug.debug(this.toString());
     }
 
-}
\ No newline at end of file
+}



Mime
View raw message