Add clarifying asserts per code review

// FREEBIE
pull/1/head
Michael Kirk 9 years ago
parent db15ff5e87
commit e68ee28e51

@ -43,8 +43,7 @@ NS_ASSUME_NONNULL_BEGIN
/** /**
* OWSSendMessageOperation encapsulates all the work associated with sending a message, e.g. uploading attachments, * OWSSendMessageOperation encapsulates all the work associated with sending a message, e.g. uploading attachments,
* getting proper keys, * getting proper keys, and retrying upon failure.
* and retrying upon failure.
* *
* Used by `OWSMessageSender` to serialize message sending, ensuring that messages are emitted in the order they * Used by `OWSMessageSender` to serialize message sending, ensuring that messages are emitted in the order they
* were sent. * were sent.
@ -109,6 +108,7 @@ NSUInteger const OWSSendMessageOperationMaxRetries = 4;
_successHandler = ^{ _successHandler = ^{
typeof(self) strongSelf = weakSelf; typeof(self) strongSelf = weakSelf;
if (!strongSelf) { if (!strongSelf) {
OWSAssert(NO);
return; return;
} }
DDLogDebug(@"%@ succeeded.", strongSelf.tag); DDLogDebug(@"%@ succeeded.", strongSelf.tag);
@ -119,6 +119,7 @@ NSUInteger const OWSSendMessageOperationMaxRetries = 4;
_failureHandler = ^(NSError *_Nonnull error) { _failureHandler = ^(NSError *_Nonnull error) {
typeof(self) strongSelf = weakSelf; typeof(self) strongSelf = weakSelf;
if (!strongSelf) { if (!strongSelf) {
OWSAssert(NO);
return; return;
} }

Loading…
Cancel
Save