Improve debugging message
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 9 Feb 2009 06:38:06 +0000 (23:38 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 9 Feb 2009 06:38:06 +0000 (23:38 -0700)
imp/js/src/DimpCore.js

index 11a4842..e90f26c 100644 (file)
@@ -23,7 +23,7 @@ DimpCore = {
     debug: function(label, e)
     {
         if (!this.is_logout && DIMP.conf.debug) {
-            alert(label + ': ' + (e instanceof Error ? e.name + '-' + e.message : Object.inspect(e)) + (e.lineNumber ? ' (Line #' + e.lineNumber + ')' : ''));
+            alert(label + ': ' + ((e instanceof Error && e.name && e.message) ? e.name + '-' + e.message : Object.inspect(e)) + (e.lineNumber ? ' (Line #' + e.lineNumber + ')' : ''));
         }
     },