File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,11 @@ return rval;\
7575#define PFBailTaskIfError (condition, error ) \
7676PFBailIfError (condition, error, [BFTask taskWithError: error])
7777
78+ #define PFPrecondition (condition, description, ...) \
79+ if (!(condition)) { \
80+ return [PFErrorUtilities errorWithCode: -1 message: [NSString stringWithFormat: description, ##__VA_ARGS__]];\
81+ }
82+
7883/* *
7984 Raises an `NSInternalInconsistencyException`. Use `description` to supply the way to fix the exception.
8085 */
Original file line number Diff line number Diff line change @@ -509,7 +509,7 @@ - (BFTask *)signUpAsync:(BFTask *)toAwait {
509509 // self doesn't have any outstanding saves, so we can safely merge its operations
510510 // into the current user.
511511
512- PFConsistencyAssert (!self._current , @" Attempt to merge currentUser with itself." );
512+ PFPrecondition (!self._current , @" Attempt to merge currentUser with itself." );
513513
514514 @synchronized ([currentUser lock ]) {
515515 NSString *oldUsername = [currentUser.username copy ];
You can’t perform that action at this time.
0 commit comments