Skip to content

Commit

Permalink
Core: Fixed error when calling .rules() on empty jquery set.
Browse files Browse the repository at this point in the history
Closes #1706.
  • Loading branch information
staabm committed Feb 12, 2016
1 parent bb87ef0 commit 7c278e0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core.js
Expand Up @@ -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;

Expand Down

0 comments on commit 7c278e0

Please sign in to comment.