From: Jeremias Maerki Date: Fri, 22 Apr 2011 08:58:55 +0000 (+0000) Subject: Fix a potential NPE which can apparently happen in very exotic cases (actually, it... X-Git-Tag: fop-1_1rc1old~223 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a7a5c39253fdf7a3c709f9af01c6308cb31e9ed1;p=xmlgraphics-fop.git Fix a potential NPE which can apparently happen in very exotic cases (actually, it rather points to a Java class library bug). git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1095895 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java b/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java index d076e6ab9..59d3930f7 100644 --- a/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java +++ b/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java @@ -127,7 +127,12 @@ public abstract class AbstractImageAdapter implements PDFImage { pdfICCStream = cs.getICCStream(); } } else { - if (cs == null && desc.startsWith("sRGB")) { + if (cs == null) { + if (desc == null || !desc.startsWith("sRGB")) { + log.warn("The default sRGB profile was indicated," + + " but the profile description does not match what was expected: " + + desc); + } //It's the default sRGB profile which we mapped to DefaultRGB in PDFRenderer cs = (PDFICCBasedColorSpace)doc.getResources().getColorSpace( new PDFName("DefaultRGB"));