]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
importNode bugfix for undefined node
authorcsarven <csarven@controlyourself.ca>
Thu, 20 Nov 2008 23:49:23 +0000 (18:49 -0500)
committercsarven <csarven@controlyourself.ca>
Thu, 20 Nov 2008 23:49:23 +0000 (18:49 -0500)
darcs-hash:20081120234923-eefa4-952f059fdda781d3f223a1f26af4741b59bb9421.gz

js/util.js

index b3165647f78ff61516d6eea127e32577d36d82e8..653d24b42f2b6cd31e4abd6e6c673ef6c4c570fb 100644 (file)
@@ -99,8 +99,14 @@ $(document).ready(function(){
                                                                                           var form_subscribe_id = form_unsubscribe_id.replace('unsubscribe', 'subscribe');
                                                                                           $("form#"+form_subscribe_id).replaceWith(form_unsubscribe);
                                                                                           $("form#"+form_unsubscribe_id).ajaxForm(UnSubscribe).each(addAjaxHidden);
-                                                                                          $("#profile_actions").append(document._importNode($('#profile_send_a_new_message', xml).get(0), true));
-                                                                                          $("#profile_actions").append(document._importNode($('#profile_nudge', xml).get(0), true));
+                                                                                          var p_sanm = $('#profile_send_a_new_message', xml).get(0);
+                                                                                          if (p_sanm) {
+                                                                                               $("#profile_actions").append(document._importNode(p_sanm, true));
+                                                                                          }
+                                                                                          var p_n = $('#profile_nudge', xml).get(0);
+                                                                                          if (p_n) {
+                                                                                                  $("#profile_actions").append(document._importNode(p_n, true));
+                                                                                          }
                                                                                     }
                                        };