[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [flashproxy/master] Handle the case where userAgent is null or undefined.



commit 60e3d0d790beb03b8d93cb15cfb9cca061d95d65
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date:   Sun Sep 4 14:50:58 2011 -0700

    Handle the case where userAgent is null or undefined.
---
 swfcat.as |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/swfcat.as b/swfcat.as
index 26bf1da..85a1a1b 100644
--- a/swfcat.as
+++ b/swfcat.as
@@ -159,13 +159,14 @@ package
             var ua:String;
 
             ua = ExternalInterface.call("window.navigator.userAgent.toString");
-
-            for (var i:uint = 0; i < UA_LIST.length; i++) {
-                var re:RegExp = UA_LIST[i];
-
-                if (ua.match(re)) {
-                    puts("Disabling because User-Agent matched " + re + ".");
-                    return true;
+            if (ua != null) {
+                for (var i:uint = 0; i < UA_LIST.length; i++) {
+                    var re:RegExp = UA_LIST[i];
+
+                    if (ua.match(re)) {
+                        puts("Disabling because User-Agent matched " + re + ".");
+                        return true;
+                    }
                 }
             }
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits