aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2006-03-26 17:21:56 +0000
committerJeremias Maerki <jeremias@apache.org>2006-03-26 17:21:56 +0000
commit938f018f2381064909e5cce6f172e4f795ffa783 (patch)
tree3779f9a967bc8c2c703bee41c85eebb45a1eba94
parent538822e7db9e67925468a3c2f49bf0bef5565743 (diff)
downloadxmlgraphics-fop-938f018f2381064909e5cce6f172e4f795ffa783.tar.gz
xmlgraphics-fop-938f018f2381064909e5cce6f172e4f795ffa783.zip
Guard against NPEs when no base URI is given.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@388927 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/servlet/ServletContextURIResolver.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/java/org/apache/fop/servlet/ServletContextURIResolver.java b/src/java/org/apache/fop/servlet/ServletContextURIResolver.java
index e442b7662..8dd555e6e 100644
--- a/src/java/org/apache/fop/servlet/ServletContextURIResolver.java
+++ b/src/java/org/apache/fop/servlet/ServletContextURIResolver.java
@@ -52,7 +52,9 @@ public class ServletContextURIResolver implements URIResolver {
if (href.startsWith(SERVLET_CONTEXT_PROTOCOL)) {
return resolveServletContextURI(href.substring(SERVLET_CONTEXT_PROTOCOL.length()));
} else {
- if (base.startsWith(SERVLET_CONTEXT_PROTOCOL) && (href.indexOf(':') < 0)) {
+ if (base != null
+ && base.startsWith(SERVLET_CONTEXT_PROTOCOL)
+ && (href.indexOf(':') < 0)) {
String abs = base + href;
return resolveServletContextURI(
abs.substring(SERVLET_CONTEXT_PROTOCOL.length()));