From: Jeremias Maerki Date: Wed, 25 Jan 2006 10:09:01 +0000 (+0000) Subject: Avoid NPE when a malformed command-line is specified. X-Git-Tag: fop-0_92-beta~177 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5bf86498b12319459fdfc24c47e6a4ef8731b046;p=xmlgraphics-fop.git Avoid NPE when a malformed command-line is specified. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@372180 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/cli/CommandLineOptions.java b/src/java/org/apache/fop/cli/CommandLineOptions.java index cc52dea05..e955f7e8c 100644 --- a/src/java/org/apache/fop/cli/CommandLineOptions.java +++ b/src/java/org/apache/fop/cli/CommandLineOptions.java @@ -153,12 +153,12 @@ public class CommandLineOptions { inputHandler = createInputHandler(); - if (outputmode.equals(MimeConstants.MIME_FOP_AWT_PREVIEW)) { + if (MimeConstants.MIME_FOP_AWT_PREVIEW.equals(outputmode)) { AWTRenderer renderer = new AWTRenderer(); renderer.setRenderable(inputHandler); //set before user agent! renderer.setUserAgent(foUserAgent); foUserAgent.setRendererOverride(renderer); - } else if (outputmode.equals(MimeConstants.MIME_FOP_AREA_TREE) + } else if (MimeConstants.MIME_FOP_AREA_TREE.equals(outputmode) && mimicRenderer != null) { // render from FO to Intermediate Format Renderer targetRenderer = foUserAgent.getRendererFactory().createRenderer(