changeset 4387:77d5cc943286

7068471: NPE in sun.font.FontConfigManager.getFontConfigFont() when libfontconfig.so is not installed Reviewed-by: jgodinez, prr Contributed-by: spoole@linux.vnet.ibm.com
author prr
date Tue, 19 Jul 2011 14:09:25 -0700
parents 0a00216a858c
children ae05aa9ede7b
files src/solaris/classes/sun/font/FontConfigManager.java
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/classes/sun/font/FontConfigManager.java	Thu Jul 07 19:18:01 2011 -0700
+++ b/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++) {