luci-app-bmx6: Initialize tun6in6 variable and add further checks
authorPau Escrich <p4u@dabax.net>
Fri, 10 Jan 2014 16:37:57 +0000 (17:37 +0100)
committerPau Escrich <p4u@dabax.net>
Fri, 10 Jan 2014 16:37:57 +0000 (17:37 +0100)
Signed-off-by: Pau Escrich <p4u@dabax.net>
luci-app-bmx6/files/usr/lib/lua/luci/view/bmx6/nodes_j.htm

index 730fd29..c9e3c9c 100644 (file)
                        // Looking for the extensions
                        var hna6 = [];
                        var tun4in6 = [];
-                       var tun6 = [];
+                       var tun6in6 = [];
+
                        for( var e = 0; e < extensions.length; e++)
                                {
                                if( extensions[e].HNA6_EXTENSION )
 
                        // Gateways
                        var gateways = '<ul>';
+                       if ( typeof(tun4in6) !== "undefined" && tun4in6 !== null )
                        for ( var t = 0; t < tun4in6.length; t++)
                                {
                                if ( tun4in6[t].networklen == "32" )
                                        gateways += "<li>"+tun4in6[t].network+'/'+tun4in6[t].networklen + ' | ' + tun4in6[t].bandwidth+'</li>';
                                }
 
+                       if ( typeof(tun6in6) !== "undefined" && tun6in6 !== null )
                        for ( var t = 0; t < tun6in6.length; t++)
                                {
                                if ( tun6in6[t].networklen == "128" )