From e48db7acffdb0e9a0f0fe4eb36e5a3f5205b73e1 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Mon, 14 Apr 2008 12:41:00 +0000 Subject: [PATCH] Fixed a possible follow-up NPE when the TTC cannot be loaded. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@647770 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java b/src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java index b223ea7a1..ce33bc5b6 100644 --- a/src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java +++ b/src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java @@ -196,7 +196,6 @@ public class FontInfoFinder { // Get a list of the TTC Font names List ttcNames = null; //List String fontFileURI = fontUrl.toExternalForm().trim(); - TTFFontLoader ttfLoader = new TTFFontLoader(fontFileURI, resolver); InputStream in = null; try { in = FontLoader.openFontUri(resolver, fontFileURI); @@ -207,6 +206,7 @@ public class FontInfoFinder { if (this.eventListener != null) { this.eventListener.fontLoadingErrorAtAutoDetection(this, fontFileURI, e); } + return null; } finally { IOUtils.closeQuietly(in); } @@ -223,7 +223,7 @@ public class FontInfoFinder { log.debug("Loading " + fontName); } try { - ttfLoader = new TTFFontLoader(fontFileURI, fontName, resolver); + TTFFontLoader ttfLoader = new TTFFontLoader(fontFileURI, fontName, resolver); customFont = ttfLoader.getFont(); if (this.eventListener != null) { customFont.setEventListener(this.eventListener); -- 2.39.5