7068471: NPE in sun.font.FontConfigManager.getFontConfigFont() when libfontconfig.so is not installed

Reviewed-by: jgodinez, prr
This commit is contained in:
Steve Poole 2011-07-19 14:09:25 -07:00 committed by Phil Race
parent c058d2d4c0
commit 4ea3a97967

View File

@ -347,6 +347,11 @@ public class FontConfigManager {
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++) {