Skip to content

Commit d7d3809

Browse files
committed
Do extra check before the processDirtyFlag stuff to avoid null pointer
1 parent 0f7037c commit d7d3809

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/client/js/services/record-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ module fng.services {
769769
$scope.$watch(
770770
"record",
771771
function (newValue, oldValue) {
772-
if ($scope.phase === "ready" && !$scope.dirtyChecked && Object.keys(oldValue).length > 0 && $scope.topLevelFormName && $scope[$scope.topLevelFormName].$dirty && typeof $scope.dataEventFunctions?.checkDirty === "function") {
772+
if ($scope.phase === "ready" && !$scope.dirtyChecked && Object.keys(oldValue).length > 0 && $scope.topLevelFormName && $scope[$scope.topLevelFormName] && $scope[$scope.topLevelFormName].$dirty && typeof $scope.dataEventFunctions?.checkDirty === "function") {
773773
$scope.dirtyChecked = true;
774774
// An opportunity to ask whether we can edit this document or not - pessimistic locking can be implemented by using this
775775
const checkDirty = $scope.dataEventFunctions.checkDirty(newValue, oldValue);

0 commit comments

Comments
 (0)