fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2010-11-17 07:25 am

[dw-free] JS error "randomicon is null" when commenting anonymously

[commit: http://hg.dwscoalition.org/dw-free/rev/df0e44320be3]

http://bugs.dwscoalition.org/show_bug.cgi?id=3115

Double-check that the element exists.

Patch by [personal profile] fu.

Files modified:
  • htdocs/js/talkpost.js
--------------------------------------------------------------------------------
diff -r d6718902899b -r df0e44320be3 htdocs/js/talkpost.js
--- a/htdocs/js/talkpost.js	Wed Nov 17 15:16:34 2010 +0800
+++ b/htdocs/js/talkpost.js	Wed Nov 17 15:25:38 2010 +0800
@@ -231,7 +231,8 @@ function subjectIconChange(icon) {
 
 function showRandomIcon() {
     var randomicon = document.getElementById("randomicon");
-    randomicon.setAttribute("class", "randomicon");
+    if (randomicon)
+        randomicon.setAttribute("class", "randomicon");
 }
 
 function randomicon() {
--------------------------------------------------------------------------------
yvi: Kaylee half-smiling, looking very pretty (Default)

[personal profile] yvi 2010-11-17 04:23 pm (UTC)(link)
Ouups :) Thanks for the fix!