<commit_before>core.directive("validatedinput", function($timeout) {
	return {
		template: '<span ng-include src="view"></span>',
		restrict: 'E',
		scope: {			
			"type": "@",
			"model": "=",
			"property": "@",
			"label": "@",
			"placeholder": "@",
			"typeahead": "=",
			"typeaheadproperty": "@",
			"truevalue": "@",
			"falsevalue": "@",
			"hint": "@",
			"toolTip": "@",
			"form": "=",
			"confirm": "&",
			"validations": "=",
			"formView": "="
		},
		link: function ($scope, element, attr) {

			$scope.inProgress = false;

			if($scope.formView) {
				$scope.view = 'bower_components/core/app/views/directives/validatedInputForm.html';
			}
			else {
				$scope.view = 'bower_components/core/app/views/directives/validatedInput.html';
			}

			if($scope.form === undefined) {
				$scope.forms = {
					dynamic: {}
				}
			}

			var getForm = function() {
				return $scope.form !== undefined ? $scope.form : $scope.forms.dynamic;
			}

			var update = function() {
				$scope.inProgress = true;
				$scope.confirm().then(function() {
					$timeout(function() {
						$scope.inProgress = false;
					}, 500);
				});
			};

			$scope.keydown = function($event) {
				// enter(13): submit value to be persisted
				if($event.which == 13 && $scope.formView && getForm().$valid) {
					update();
				}
				// escape(27): reset value using shadow
				if($event.which == 27) {
					$scope.model.refresh();
				}
			};

			$scope.blur = function($event) {
				if($scope.formView && getForm().$valid) {
					if($scope.confirm !== undefined) {
						update();
					}
				}
			};

			$scope.change = function($event) {
				if(getForm().$valid) {
					if($scope.confirm !== undefined) {
						update();
					}
				}
			};

		}
	};
});<commit_msg>Null check on confirm method before calling update.<commit_after>core.directive("validatedinput", function($timeout) {
	return {
		template: '<span ng-include src="view"></span>',
		restrict: 'E',
		scope: {			
			"type": "@",
			"model": "=",
			"property": "@",
			"label": "@",
			"placeholder": "@",
			"typeahead": "=",
			"typeaheadproperty": "@",
			"truevalue": "@",
			"falsevalue": "@",
			"hint": "@",
			"toolTip": "@",
			"form": "=",
			"confirm": "&",
			"validations": "=",
			"formView": "="
		},
		link: function ($scope, element, attr) {

			$scope.inProgress = false;

			if($scope.formView) {
				$scope.view = 'bower_components/core/app/views/directives/validatedInputForm.html';
			}
			else {
				$scope.view = 'bower_components/core/app/views/directives/validatedInput.html';
			}

			if($scope.form === undefined) {
				$scope.forms = {
					dynamic: {}
				}
			}

			var getForm = function() {
				return $scope.form !== undefined ? $scope.form : $scope.forms.dynamic;
			}

			var update = function() {
				$scope.inProgress = true;
				$scope.confirm().then(function() {
					$timeout(function() {
						$scope.inProgress = false;
					}, 500);
				});
			};

			$scope.keydown = function($event) {
				// enter(13): submit value to be persisted
				if($event.which == 13 && $scope.formView && getForm().$valid) {
					if($scope.confirm !== undefined) {
						update();
					}
				}
				// escape(27): reset value using shadow
				if($event.which == 27) {
					$scope.model.refresh();
				}
			};

			$scope.blur = function($event) {
				if($scope.formView && getForm().$valid) {
					if($scope.confirm !== undefined) {
						update();
					}
				}
			};

			$scope.change = function($event) {
				if(getForm().$valid) {
					if($scope.confirm !== undefined) {
						update();
					}
				}
			};

		}
	};
});
{'fraction_non_alphanumeric': 0.2105849582172702, 'fraction_numerical': 0.006128133704735376, 'mean_word_length': 2.649390243902439, 'pattern_counts': {'":': 30, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3819921', 'n_tokens_mistral': 1625, 'n_tokens_neox': 1219, 'n_words': 197}