changeset 5401:35c8f57c7c53

7068471: NPE in sun.font.FontConfigManager.getFontConfigFont() when libfontconfig.so is not installed Reviewed-by: jgodinez, prr
author spoole
date Tue, 19 Jul 2011 14:09:25 -0700
parents a48da818ed65
children 4a8186619887
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	Fri Jul 06 10:36:19 2012 +0800
+++ 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++) {