Don't reference undefined variables.

        Patch by afuna. 

diffs (22 lines):

diff -r e36c136e204d -r a9fbb12e6ff8 htdocs/js/esn.js
--- a/htdocs/js/esn.js  Thu Jul 16 21:46:29 2009 -0500
+++ b/htdocs/js/esn.js  Thu Jul 16 22:10:15 2009 -0500
@@ -142,7 +142,17 @@ ESN.trackBtnClickHandler = function (evt
         commentsTrackBtn = TrackCheckbox("someone replies in this comment 
thread", 1);
     } else {
         // entry tracking button
-        newEntryTrackBtn = TrackCheckbox(LJ_cmtinfo["journal"] + " posts a new 
entry", trackingNewEntries);
+        var journal; 
+        
+        if ( typeof LJ_cmtinfo !== 'undefined' ) {
+            journal = LJ_cmtinfo["journal"];
+        } else if ( typeof Site !== 'undefined' ) {
+            journal = Site.currentJournal;
+        }
+
+        if ( journal ) {
+            newEntryTrackBtn = TrackCheckbox( journal + " posts a new entry", 
trackingNewEntries );
+        }
         commentsTrackBtn = TrackCheckbox("someone comments on this post", 
trackingNewComments);
     }
 
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to