8034119: [parfait] JNI exception pending in jdk/src/macosx/native/sun/font/CCharToGlyphMapper.m
authorprr
Tue, 18 Mar 2014 11:31:11 -0700
changeset 23669 24b23ba32873
parent 23668 98a5be057aad
child 23670 51dcbdabb951
8034119: [parfait] JNI exception pending in jdk/src/macosx/native/sun/font/CCharToGlyphMapper.m Reviewed-by: serb, jgodinez
jdk/src/macosx/native/sun/font/CCharToGlyphMapper.m
--- a/jdk/src/macosx/native/sun/font/CCharToGlyphMapper.m	Tue Mar 18 18:11:41 2014 +0400
+++ b/jdk/src/macosx/native/sun/font/CCharToGlyphMapper.m	Tue Mar 18 11:31:11 2014 -0700
@@ -101,10 +101,13 @@
     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);
+        (*env)->ReleasePrimitiveArrayCritical(env, unicodes,
+                                              unicodesAsChars, JNI_ABORT);
+    }
 
 JNF_COCOA_EXIT(env);
 }