@@ -456,12 +456,10 @@ + (BFTask *)_deepSaveAsyncChildrenOfObject:(id)object withCurrentUser:(PFUser *)
456456 }
457457 remaining = nextBatch;
458458
459- if (current.count == 0 ) {
460- // We do cycle-detection when building the list of objects passed to this
461- // function, so this should never get called. But we should check for it
462- // anyway, so that we get an exception instead of an infinite loop.
463- PFConsistencyAssertionFailure (@" Unable to save a PFObject with a relation to a cycle." );
464- }
459+ // We do cycle-detection when building the list of objects passed to this
460+ // function, so this should never get called. But we should check for it
461+ // anyway, so that we get an exception instead of an infinite loop.
462+ PFPreconditionWithTask (current.count != 0 , @" Unable to save a PFObject with a relation to a cycle." );
465463
466464 // If a lazy user is one of the objects in the array, resolve its laziness now and
467465 // remove it from the list of things to save.
@@ -622,12 +620,10 @@ + (BFTask *)_enqueueSaveEventuallyChildrenOfObject:(PFObject *)object currentUse
622620 }
623621 remaining = nextBatch;
624622
625- if (current.count == 0 ) {
626- // We do cycle-detection when building the list of objects passed to this
627- // function, so this should never get called. But we should check for it
628- // anyway, so that we get an exception instead of an infinite loop.
629- PFConsistencyAssertionFailure (@" Unable to save a PFObject with a relation to a cycle." );
630- }
623+ // We do cycle-detection when building the list of objects passed to this
624+ // function, so this should never get called. But we should check for it
625+ // anyway, so that we get an exception instead of an infinite loop.
626+ PFPrecondition (current.count != 0 , @" Unable to save a PFObject with a relation to a cycle." );
631627
632628 // If a lazy user is one of the objects in the array, resolve its laziness now and
633629 // remove it from the list of things to save.
0 commit comments