Skip to content

Commit

Permalink
Make -processAttachmentsForRevision ignore the return value of -mutat…
Browse files Browse the repository at this point in the history
…eAttachments

Per code review, Make -processAttachmentsForRevision ignore the return value of -mutateAttachments.
  • Loading branch information
pasin committed Apr 24, 2015
1 parent 2b214e4 commit d7047ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Source/CBLDatabase+Attachments.m
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ - (BOOL) processAttachmentsForRevision: (CBL_MutableRevision*)rev
unsigned generation = [CBL_Revision generationFromRevID: prevRevID] + 1;
__block NSDictionary* parentAttachments = nil;

return [rev mutateAttachments: ^NSDictionary *(NSString *name, NSDictionary *attachInfo) {
[rev mutateAttachments: ^NSDictionary *(NSString *name, NSDictionary *attachInfo) {
CBL_Attachment* attachment = [[CBL_Attachment alloc] initWithName: name
info: attachInfo
status: outStatus];
Expand Down Expand Up @@ -338,6 +338,8 @@ - (BOOL) processAttachmentsForRevision: (CBL_MutableRevision*)rev
Assert(attachment.isValid);
return attachment.asStubDictionary;
}];

return !CBLStatusIsError(*outStatus);
}


Expand Down
2 changes: 1 addition & 1 deletion Source/CBLDatabase+Insertion.m
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ - (CBLStatus) forceInsert: (CBL_Revision*)inRev
NSString* prevRevID = history.count >= 2 ? history[1] : nil;
if (![self processAttachmentsForRevision: updatedRev
prevRevID: prevRevID
status: &status] && CBLStatusIsError(status))
status: &status])
return status;
inRev = updatedRev;
}
Expand Down

0 comments on commit d7047ed

Please sign in to comment.