Browse Source

include/webutil.js: fix dirObj undefined attribute.

Joel Martin 14 years ago
parent
commit
0a92014700
1 changed files with 5 additions and 1 deletions
  1. 5 1
      include/webutil.js

+ 5 - 1
include/webutil.js

@@ -59,7 +59,11 @@ WebUtil.dirObj = function (obj, depth, parent) {
             msg += WebUtil.dirObj(obj[i], depth-1, parent + "." + i);
         } else {
             //val = new String(obj[i]).replace("\n", " ");
-            val = obj[i].toString().replace("\n", " ");
+            if (typeof(obj[i]) === "undefined") {
+                val = "undefined";
+            } else {
+                val = obj[i].toString().replace("\n", " ");
+            }
             if (val.length > 30) {
                 val = val.substr(0,30) + "...";
             }