src/macosx/native/sun/font/CCharToGlyphMapper.m

Print this page

        

@@ -99,12 +99,15 @@
     }
 
     jchar *unicodesAsChars =
         (*env)->GetPrimitiveArrayCritical(env, unicodes, NULL);
 
-    AllocateGlyphBuffer(env, awtFont, count, (UniChar *)unicodesAsChars, glyphs);
+    if (unicodesAsChars != NULL) {
+        AllocateGlyphBuffer(env, awtFont, count,
+                           (UniChar *)unicodesAsChars, glyphs);
 
     (*env)->ReleasePrimitiveArrayCritical(env, unicodes,
                                           unicodesAsChars, JNI_ABORT);
+    }
 
 JNF_COCOA_EXIT(env);
 }