Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #10783 -- Fixed Javascript error when adding a new object in ad…

…min.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10516 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 0d2cf7bdd6ee7b404f6e0f8eebfa9e8979ba7671 1 parent f4072f5
Malcolm Tredinnick authored April 11, 2009
4  django/contrib/admin/media/js/getElementsBySelector.js
@@ -38,8 +38,8 @@ document.getElementsBySelector = function(selector) {
38 38
       var tagName = bits[0];
39 39
       var id = bits[1];
40 40
       var element = document.getElementById(id);
41  
-      if (tagName && element.nodeName.toLowerCase() != tagName) {
42  
-        // tag with that ID not found, return false
  41
+      if (!element || (tagName && element.nodeName.toLowerCase() != tagName)) {
  42
+        // ID not found or tag with that ID not found, return false.
43 43
         return new Array();
44 44
       }
45 45
       // Set currentContext to contain just this element

0 notes on commit 0d2cf7b

Please sign in to comment.
Something went wrong with that request. Please try again.