File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
parse/src/main/java/com/parse Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -590,7 +590,9 @@ protected boolean visit(Object node) {
590590 // Check for cycles of new objects. Any such cycle means it will be
591591 // impossible to save this collection of objects, so throw an exception.
592592 if (object .getObjectId () != null ) {
593- seenNew = new HashSet <>();
593+ if (!seenNew .isEmpty ()) {
594+ seenNew = new HashSet <>();
595+ }
594596 } else {
595597 if (seenNew .contains (object )) {
596598 throw new RuntimeException ("Found a circular dependency while saving." );
@@ -605,7 +607,6 @@ protected boolean visit(Object node) {
605607 if (seen .contains (object )) {
606608 return true ;
607609 }
608- seen = new HashSet <>(seen );
609610 seen .add (object );
610611
611612 // Recurse into this object's children looking for dirty children.
You can’t perform that action at this time.
0 commit comments