mirror of
https://github.com/jquery-validation/jquery-validation.git
synced 2025-12-24 12:13:59 +01:00
Core: Fixed error when calling .rules() on empty jquery set.
Closes #1706.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user