7068471: NPE in sun.font.FontConfigManager.getFontConfigFont() when libfontconfig.so is not installed
Reviewed-by: jgodinez, prr
Contributed-by: spoole@linux.vnet.ibm.com
--- 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<fontConfigFonts.length; i++) {