Author: toad
Date: 2007-04-25 20:12:54 +0000 (Wed, 25 Apr 2007)
New Revision: 12958

Modified:
   trunk/plugins/JSTUN/JSTUN.java
Log:
Fix JSTUN reporting of IPs, hopefully

Modified: trunk/plugins/JSTUN/JSTUN.java
===================================================================
--- trunk/plugins/JSTUN/JSTUN.java      2007-04-25 19:57:26 UTC (rev 12957)
+++ trunk/plugins/JSTUN/JSTUN.java      2007-04-25 20:12:54 UTC (rev 12958)
@@ -84,7 +84,7 @@
                                e.printStackTrace();
                        }
                }
-               return null;
+               return (DetectedIP[]) out.toArray(new DetectedIP[out.size()]);
        }

        private DetectedIP convert(DiscoveryInfo info) {
@@ -142,7 +142,10 @@
                synchronized(this) {
                        while(true) {
                                if(detectors.isEmpty()) {
-                                       if(detected.isEmpty()) return null;
+                                       if(detected.isEmpty()) {
+                                               System.err.println("STUN failed 
to detect IP addresses");
+                                               return null;
+                                       }
                                        DetectedIP[] ips = (DetectedIP[]) 
detected.toArray(new DetectedIP[detected.size()]);
                                        return ips;
                                }


Reply via email to