From 34d7c97ca26d4b018226c03784cbaaba3dce24a9 Mon Sep 17 00:00:00 2001 From: Adrian Cumiskey Date: Wed, 28 May 2008 12:56:24 +0000 Subject: Warning given when mimetype provided is missing/null for whatever reason git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@660931 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/render/afp/modca/Registry.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/java') diff --git a/src/java/org/apache/fop/render/afp/modca/Registry.java b/src/java/org/apache/fop/render/afp/modca/Registry.java index c81b4a289..5287f1a2b 100644 --- a/src/java/org/apache/fop/render/afp/modca/Registry.java +++ b/src/java/org/apache/fop/render/afp/modca/Registry.java @@ -21,6 +21,8 @@ package org.apache.fop.render.afp.modca; import java.util.Collections; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.fop.render.afp.DataObjectInfo; import org.apache.fop.render.afp.ImageObjectInfo; import org.apache.xmlgraphics.util.MimeConstants; @@ -29,6 +31,8 @@ import org.apache.xmlgraphics.util.MimeConstants; * MOD:CA Registry of object types */ public final class Registry { + /** logging instance */ + private static final Log log = LogFactory.getLog("org.apache.fop.afp"); /** IOB supported object types */ private static final byte COMPID_GIF = 22; @@ -131,7 +135,11 @@ public final class Registry { if (dataObjectInfo instanceof ImageObjectInfo) { ImageObjectInfo imageInfo = (ImageObjectInfo)dataObjectInfo; String mimeType = imageInfo.getMimeType(); - entry = (Registry.ObjectType)mimeEntryMap.get(mimeType); + if (mimeType != null) { + entry = (Registry.ObjectType)mimeEntryMap.get(mimeType); + } else { + log.info("mimetype for " + dataObjectInfo + " is null"); + } } return entry; } -- cgit v1.2.3