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() {
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
No Subject Icon Selected
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org