]> source.dussan.org Git - poi.git/commitdiff
bug 60484: avoid NPE
authorJaven O'Neal <onealj@apache.org>
Tue, 3 Jan 2017 04:35:54 +0000 (04:35 +0000)
committerJaven O'Neal <onealj@apache.org>
Tue, 3 Jan 2017 04:35:54 +0000 (04:35 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1777063 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java

index ab230580a1d3b7252065f583c36c01d348ce7d01..7eb3af2834fdd364a09deaae5ef6e69c45b05cfc 100644 (file)
@@ -421,8 +421,11 @@ public final class Picture
 
         if ( escherRecord instanceof EscherBSERecord )
         {
-            return ( (EscherBSERecord) escherRecord ).getBlipRecord()
-                    .getPicturedata();
+            EscherBlipRecord blip = ( (EscherBSERecord) escherRecord ).getBlipRecord();
+            if (blip != null) {
+                return blip.getPicturedata();
+            
+            }
         }
         return new byte[0];
     }