# HG changeset patch # User prr # Date 1311109765 25200 # Node ID 7f82305d48d10800ca54d0a0420f30870b1ae2f0 # Parent 9d3f6507f55faf179d880d86565a1dce1e400cee 7068471: NPE in sun.font.FontConfigManager.getFontConfigFont() when libfontconfig.so is not installed Reviewed-by: jgodinez, prr Contributed-by: spoole@linux.vnet.ibm.com diff -r 9d3f6507f55f -r 7f82305d48d1 jdk/src/solaris/classes/sun/font/FontConfigManager.java --- a/jdk/src/solaris/classes/sun/font/FontConfigManager.java Thu Jul 07 19:18:01 2011 -0700 +++ b/jdk/src/solaris/classes/sun/font/FontConfigManager.java Tue Jul 19 14:09:25 2011 -0700 @@ -347,6 +347,11 @@ name = name.toLowerCase(); initFontConfigFonts(false); + if (fontConfigFonts == null) { + // This avoids an immediate NPE if fontconfig look up failed + // but doesn't guarantee this is a recoverable situation. + return null; + } FcCompFont fcInfo = null; for (int i=0; i