Skip to content

Commit

Permalink
Check $inlineLabel.length so as not to trigger TypeError if not present
Browse files Browse the repository at this point in the history
  • Loading branch information
fdintino committed Jul 12, 2017
1 parent add6726 commit f8ad948
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion nested_admin/static/nested_admin/dist/nested_admin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nested_admin/static/nested_admin/dist/nested_admin.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion nested_admin/static/nested_admin/dist/nested_admin.min.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ export function updatePositions(prefix) {

// Set header position for stacked inlines in Django 1.9+
var $inlineLabel = $this.find('> h3 > .inline_label');
$inlineLabel.html($inlineLabel.html().replace(/(#\d+)/g, '#' + count));
if ($inlineLabel.length) {
$inlineLabel.html($inlineLabel.html().replace(/(#\d+)/g, '#' + count));
}
count++;

var $fields = $this.djangoFormField('*'),
Expand Down

0 comments on commit f8ad948

Please sign in to comment.