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 @@ -606,7 +606,9 @@ protected boolean visit(Object node) {
606
606
// Check for cycles of new objects. Any such cycle means it will be
607
607
// impossible to save this collection of objects, so throw an exception.
608
608
if (object .getObjectId () != null ) {
609
- seenNew = new HashSet <>();
609
+ if (!seenNew .isEmpty ()) {
610
+ seenNew = new HashSet <>();
611
+ }
610
612
} else {
611
613
if (seenNew .contains (object )) {
612
614
throw new RuntimeException ("Found a circular dependency while saving." );
@@ -621,7 +623,6 @@ protected boolean visit(Object node) {
621
623
if (seen .contains (object )) {
622
624
return true ;
623
625
}
624
- seen = new HashSet <>(seen );
625
626
seen .add (object );
626
627
627
628
// Recurse into this object's children looking for dirty children.
You can’t perform that action at this time.
0 commit comments