diff options
author | Scott González <scott.gonzalez@gmail.com> | 2017-05-02 12:42:49 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2017-05-02 12:42:49 -0400 |
commit | adcf9b6f6ef9c6dfa88932b40307f581e65bc667 (patch) | |
tree | 70193bea919dab6e214f4deded4f9a0849a2ad40 /ui/labels.js | |
parent | 0d25a36eecb9e5598596208e4852b3c3fdbf5510 (diff) | |
download | jquery-ui-adcf9b6f6ef9c6dfa88932b40307f581e65bc667.tar.gz jquery-ui-adcf9b6f6ef9c6dfa88932b40307f581e65bc667.zip |
Labels: Handle empty sets
Fixes #15184
Diffstat (limited to 'ui/labels.js')
-rw-r--r-- | ui/labels.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ui/labels.js b/ui/labels.js index 2a78d886b..1bf56ac41 100644 --- a/ui/labels.js +++ b/ui/labels.js @@ -27,6 +27,10 @@ return $.fn.labels = function() { var ancestor, selector, id, labels, ancestors; + if ( !this.length ) { + return this.pushStack( [] ); + } + // Check control.labels first if ( this[ 0 ].labels && this[ 0 ].labels.length ) { return this.pushStack( this[ 0 ].labels ); |