Core: Fixed error when calling .rules() on empty jquery set.

Closes #1706.
This commit is contained in:
Markus Staab
2016-02-12 14:23:43 +01:00
parent bb87ef02d5
commit 7c278e05cc

View File

@@ -117,6 +117,12 @@ $.extend( $.fn, {
// http://jqueryvalidation.org/rules/
rules: function( command, argument ) {
// If nothing is selected, return nothing; can't chain anyway
if ( !this.length ) {
return;
}
var element = this[ 0 ],
settings, staticRules, existingRules, data, param, filtered;