aboutsummaryrefslogtreecommitdiffstats
path: root/ui/labels.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/labels.js')
-rw-r--r--ui/labels.js4
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 );