From c7a46a8f4e7d4b97d241ceba582364bf0287cf27 Mon Sep 17 00:00:00 2001 From: Glenn Adams Date: Thu, 9 Oct 2014 04:48:19 +0000 Subject: [PATCH] FOP-2415: prevent NPE when Indic script syllabizer is not available git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1630279 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/complexscripts/scripts/IndicScriptProcessor.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java b/src/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java index a341ef123..ad533b843 100644 --- a/src/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java +++ b/src/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java @@ -216,7 +216,7 @@ public class IndicScriptProcessor extends DefaultScriptProcessor { } private GlyphSequence[] syllabize(GlyphSequence gs, String script, String language) { - return Syllabizer.getSyllabizer(script, language, getSyllabizerClass()) .syllabize(gs); + return Syllabizer.getSyllabizer(script, language, getSyllabizerClass()).syllabize(gs); } private GlyphSequence unsyllabize(GlyphSequence gs, GlyphSequence[] sa) { @@ -405,7 +405,8 @@ public class IndicScriptProcessor extends DefaultScriptProcessor { String sid = makeSyllabizerId(script, language); Syllabizer s = syllabizers.get(sid); if (s == null) { - if ((s = makeSyllabizer(script, language, syllabizerClass)) == null) { + if ((syllabizerClass == null) || ((s = makeSyllabizer(script, language, syllabizerClass)) == null)) { + log.warn("No syllabizer available for script '" + script + "', language '" + language + "', using default Indic syllabizer."); s = new DefaultSyllabizer(script, language); } syllabizers.put(sid, s); -- 2.39.5