Author: mtredinnick
Date: 2009-04-11 06:33:10 -0500 (Sat, 11 Apr 2009)
New Revision: 10516
Modified:
django/trunk/django/contrib/admin/media/js/getElementsBySelector.js
Log:
Fixed #10783 -- Fixed Javascript error when adding a new object in admin.
Modified: django/trunk/django/contrib/admin/media/js/getElementsBySelector.js
===================================================================
--- django/trunk/django/contrib/admin/media/js/getElementsBySelector.js
2009-04-11 11:32:50 UTC (rev 10515)
+++ django/trunk/django/contrib/admin/media/js/getElementsBySelector.js
2009-04-11 11:33:10 UTC (rev 10516)
@@ -38,8 +38,8 @@
var tagName = bits[0];
var id = bits[1];
var element = document.getElementById(id);
- if (tagName && element.nodeName.toLowerCase() != tagName) {
- // tag with that ID not found, return false
+ if (!element || (tagName && element.nodeName.toLowerCase() != tagName)) {
+ // ID not found or tag with that ID not found, return false.
return new Array();
}
// Set currentContext to contain just this element
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---