Skip to content

Commit bf024ac

Browse files
author
Chris Jensen
committed
isValidateDisabled - fix error when no parents
Return false when there are no parents instead of throwing error
1 parent d2bb47f commit bf024ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/validation.service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ angular.module('bootstrap.angular.validation').factory('BsValidationService', ['
157157
}
158158

159159
var $parentForm = $element.parents('form');
160-
return $parentForm && $parentForm[0].attributes.hasOwnProperty(attribute);
160+
return $parentForm[0] && $parentForm[0].attributes.hasOwnProperty(attribute);
161161
},
162162

163163
removeErrorClass: function($formGroupElement) {

0 commit comments

Comments
 (0)