From 16c68c9f05595287f96efeff5cf4ec15fd0795e8 Mon Sep 17 00:00:00 2001 From: Javen O'Neal Date: Tue, 3 Jan 2017 04:35:54 +0000 Subject: [PATCH] bug 60484: avoid NPE git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1777063 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/org/apache/poi/hwpf/usermodel/Picture.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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]; }