From: Javen O'Neal Date: Tue, 3 Jan 2017 04:35:54 +0000 (+0000) Subject: bug 60484: avoid NPE X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9a32a42130899285149b4bfd8199dea6160b3f98;p=poi.git bug 60484: avoid NPE git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1777063 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java index ab230580a1..7eb3af2834 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java @@ -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]; }