Skip to content

Commit 39d225b

Browse files
authored
Update snippet for preventing infinite loops
Per internal bug 74829410.
1 parent 8aed09c commit 39d225b

File tree

1 file changed

+1
-1
lines changed
  • firestore/extend-with-functions/functions

1 file changed

+1
-1
lines changed

firestore/extend-with-functions/functions/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ function writingData() {
115115

116116
// We'll only update if the name has changed.
117117
// This is crucial to prevent infinite loops.
118-
if (data.name == previousData.name) return;
118+
if (data.name == previousData.name) return null;
119119

120120
// Retrieve the current count of name changes
121121
let count = data.name_change_count;

0 commit comments

Comments
 (0)