changeset 5849:7d1dfcec57c0

IOS CHANGE ONLY: avoid exception when UUID algorithm not present
author snorthov
date Thu, 28 Nov 2013 14:00:07 -0500
parents 1db4c60bfd5b
children 022ac7cdcad1
files modules/web/src/ios/java/javafx/scene/web/JS2JavaBridge.java
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/modules/web/src/ios/java/javafx/scene/web/JS2JavaBridge.java	Thu Nov 28 22:52:36 2013 +0400
+++ b/modules/web/src/ios/java/javafx/scene/web/JS2JavaBridge.java	Thu Nov 28 14:00:07 2013 -0500
@@ -65,7 +65,11 @@
         Random ranGen = new SecureRandom();
         byte[] aesKey = new byte[16]; // 16 bytes = 128 bits
         ranGen.nextBytes(aesKey);
-        TOKEN = UUID.nameUUIDFromBytes(aesKey).toString();
+        try {
+            TOKEN = UUID.nameUUIDFromBytes(aesKey).toString();
+        } catch (Error ex) {
+            TOKEN = null;
+        }
         javaBridge = "window.mustek('"+TOKEN+"')";
     }
 
@@ -215,7 +219,7 @@
             String uuid = splitted[1];
             String callbackID = splitted[2];
             try {
-                if (!TOKEN.equals(uuid)) {
+                if (TOKEN != null && !TOKEN.equals(uuid)) {
                     throw new SecurityException("Wrong javacall arguments.");
                 }
                 String objId = splitted[3];