From 21ed5240e7a5db6b2896987a4c172dcf4a1951c1 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Sun, 21 Jul 2019 08:39:56 +0000 Subject: [PATCH] try to fix NPE in tests git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1863516 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/sl/draw/BitmapImageRenderer.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/java/org/apache/poi/sl/draw/BitmapImageRenderer.java b/src/java/org/apache/poi/sl/draw/BitmapImageRenderer.java index 140fc777f2..3643b976c0 100644 --- a/src/java/org/apache/poi/sl/draw/BitmapImageRenderer.java +++ b/src/java/org/apache/poi/sl/draw/BitmapImageRenderer.java @@ -239,6 +239,9 @@ public class BitmapImageRenderer implements ImageRenderer { @Override public BufferedImage getImage(Dimension2D dim) { + if (img == null) { + return img; + } double w_old = img.getWidth(); double h_old = img.getHeight(); BufferedImage scaled = new BufferedImage((int)w_old, (int)h_old, BufferedImage.TYPE_INT_ARGB); -- 2.39.5