From: Glenn Adams Date: Thu, 9 Oct 2014 04:48:19 +0000 (+0000) Subject: FOP-2415: prevent NPE when Indic script syllabizer is not available X-Git-Tag: fop-2_0~50 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c7a46a8f4e7d4b97d241ceba582364bf0287cf27;p=xmlgraphics-fop.git 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 --- 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);