Fix for JS error on Flows tab. 50/950/1
authorlakshya <lakshya@cisco.com>
Wed, 21 Aug 2013 22:44:27 +0000 (15:44 -0700)
committerlakshya <lakshya@cisco.com>
Wed, 21 Aug 2013 22:46:04 +0000 (15:46 -0700)
This fixes the JS error "TypeError: $span.data(...) is null" on the flows tab by introducing a null check.

Change-Id: Ibbf2141bdca83b445e0d5d162cfe8a3e9a1fe9a0
Signed-off-by: lakshya <lakshya@cisco.com>
opendaylight/web/flows/src/main/resources/js/page.js

index 2a2dbf5..0f1eabb 100644 (file)
@@ -343,11 +343,13 @@ one.f.flows = {
                     $tr = $(tr);
                     $span = $("td span", $tr);
                     var flowstatus = $span.data("flowstatus");
-                    var installInHw = $span.data("installinhw").toString();
-                    if(installInHw == "true" && flowstatus == "Success") {
-                        $tr.addClass("success");
-                    } else {
-                        $tr.addClass("warning");
+                    if($span.data("installinhw") != null) {
+                        var installInHw = $span.data("installinhw").toString();
+                        if(installInHw == "true" && flowstatus == "Success") {
+                            $tr.addClass("success");
+                        } else {
+                            $tr.addClass("warning");
+                        }
                     }
                     // attach mouseover to show pointer cursor
                     $tr.mouseover(function() {