diff options
author | Jeremias Maerki <jeremias@apache.org> | 2008-04-17 21:25:02 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2008-04-17 21:25:02 +0000 |
commit | c7cf9e0dd189de4960bcc44d9a10d217bbd13896 (patch) | |
tree | 9cc472979586da0719bda12e98ae5f6c6c03d29a /src/java/org | |
parent | 867bded418d667d3d5889b8ac66169a676623f86 (diff) | |
download | xmlgraphics-fop-c7cf9e0dd189de4960bcc44d9a10d217bbd13896.tar.gz xmlgraphics-fop-c7cf9e0dd189de4960bcc44d9a10d217bbd13896.zip |
Throw a useful exception when the user agent isn't set on the renderer. This has been a problem for more than one person setting up their own renderer using FOUserAgent.setRendererOverride().
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@649283 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
-rw-r--r-- | src/java/org/apache/fop/render/AbstractRenderer.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/java/org/apache/fop/render/AbstractRenderer.java b/src/java/org/apache/fop/render/AbstractRenderer.java index ca3d007d0..816fa4067 100644 --- a/src/java/org/apache/fop/render/AbstractRenderer.java +++ b/src/java/org/apache/fop/render/AbstractRenderer.java @@ -124,12 +124,19 @@ public abstract class AbstractRenderer /** {@inheritDoc} */ public FOUserAgent getUserAgent() { + if (userAgent == null) { + throw new IllegalStateException("FOUserAgent has not been set on Renderer"); + } return userAgent; } /** {@inheritDoc} */ public void startRenderer(OutputStream outputStream) - throws IOException { } + throws IOException { + if (userAgent == null) { + throw new IllegalStateException("FOUserAgent has not been set on Renderer"); + } + } /** {@inheritDoc} */ public void stopRenderer() |