[Picfinity-commit] SF.net SVN: picfinity: [72] trunk/.themes/db/db.js
Status: Beta
Brought to you by:
espadav8
From: <esp...@us...> - 2008-03-13 14:57:44
|
Revision: 72 http://picfinity.svn.sourceforge.net/picfinity/?rev=72&view=rev Author: espadav8 Date: 2008-03-13 07:56:20 -0700 (Thu, 13 Mar 2008) Log Message: ----------- Check if the firstChild is null before trying to get it's value (if it is null, use an empty string) If the email/web address are empty don't set the attributes Modified Paths: -------------- trunk/.themes/db/db.js Modified: trunk/.themes/db/db.js =================================================================== --- trunk/.themes/db/db.js 2007-09-11 12:24:58 UTC (rev 71) +++ trunk/.themes/db/db.js 2008-03-13 14:56:20 UTC (rev 72) @@ -815,18 +815,18 @@ for (var j = 0; j < currentComment.childNodes.length; j++) { var currentNodeName = currentComment.childNodes[j].nodeName; - var currentNodeValue = currentComment.childNodes[j].firstChild.nodeValue; + var currentNodeValue = ( currentComment.childNodes[j].firstChild != null ) ? currentComment.childNodes[j].firstChild.nodeValue : ''; if (currentNodeName == "name") { commentOwnerAnchor.appendChild(document.createTextNode(currentNodeValue)); } - else if (currentNodeName == "www") + else if ( (currentNodeName == "www") && ( currentNodeValue != '') ) { commentOwnerWebAnchor.appendChild(document.createTextNode(currentNodeValue)); commentOwnerWebAnchor.setAttribute("href", "http://" + currentNodeValue); } - else if (currentNodeName == "email") + else if ( (currentNodeName == "email") && ( currentNodeValue != '') ) { commentOwnerAnchor.setAttribute("href", "mailto:" + currentNodeValue); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |