]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Avoid NPE when a malformed command-line is specified.
authorJeremias Maerki <jeremias@apache.org>
Wed, 25 Jan 2006 10:09:01 +0000 (10:09 +0000)
committerJeremias Maerki <jeremias@apache.org>
Wed, 25 Jan 2006 10:09:01 +0000 (10:09 +0000)
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

index cc52dea05bb352835f8b23da400e02d5f34dd0bb..e955f7e8ce3527c6d7f60c1ec4984d4f1583f617 100644 (file)
@@ -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(