From 3e8128c8d05a7f08258913a81a438d0666bdf220 Mon Sep 17 00:00:00 2001
From: Jeremias Maerki <jeremias@apache.org>
Date: Mon, 31 Mar 2008 08:39:49 +0000
Subject: Fixed possible NullPointerException in AFM kerning table build code.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@642923 13f79535-47bb-0310-9956-ffa450edef68
---
 src/java/org/apache/fop/fonts/type1/AFMFile.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/java/org/apache/fop/fonts/type1/AFMFile.java b/src/java/org/apache/fop/fonts/type1/AFMFile.java
index 6a1973843..3cb4b3343 100644
--- a/src/java/org/apache/fop/fonts/type1/AFMFile.java
+++ b/src/java/org/apache/fop/fonts/type1/AFMFile.java
@@ -413,7 +413,7 @@ public class AFMFile {
             Map.Entry entryFrom = (Map.Entry)iterFrom.next();
             String name1 = (String)entryFrom.getKey();
             AFMCharMetrics chm1 = getChar(name1);
-            if (!chm1.hasCharCode()) {
+            if (chm1 == null || !chm1.hasCharCode()) {
                 continue;
             }
             Map container = null;
@@ -423,7 +423,7 @@ public class AFMFile {
                 Map.Entry entryTo = (Map.Entry)iterTo.next();
                 String name2 = (String)entryTo.getKey();
                 AFMCharMetrics chm2 = getChar(name2);
-                if (!chm2.hasCharCode()) {
+                if (chm2 == null || !chm2.hasCharCode()) {
                     continue;
                 }
                 if (container == null) {
-- 
cgit v1.2.3