django-sortedm2m
django-sortedm2m copied to clipboard
[Widget.js] Exception when empty list
When the queryset is empty, the widget.js does not handle and the exception occurred:
widget.js:27 Uncaught TypeError: Cannot read property 'match' of undefined
at prepareUl (widget.js:27)
at HTMLUListElement.<anonymous> (widget.js:53)
at Function.each (jquery.js:365)
at jQuery.fn.init.each (jquery.js:137)
at iterateUl (widget.js:50)
at HTMLDocument.<anonymous> (widget.js:60)
at fire (jquery.js:3187)
at Object.fireWith [as resolveWith] (jquery.js:3317)
at Function.ready (jquery.js:3536)
at HTMLDocument.completed (jquery.js:3552)