From 5bf86498b12319459fdfc24c47e6a4ef8731b046 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Wed, 25 Jan 2006 10:09:01 +0000 Subject: [PATCH] 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 --- src/java/org/apache/fop/cli/CommandLineOptions.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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( -- 2.39.5