CR: fixup nil/error handling
This commit is contained in:
parent
546dbb13c4
commit
e490163896
@ -2837,7 +2837,7 @@ typedef enum : NSUInteger {
|
||||
_Nullable id<DataSource> dataSource = [DataSourcePath dataSourceWithURL:url
|
||||
shouldDeleteOnDeallocation:NO
|
||||
error:&error];
|
||||
if (error != nil) {
|
||||
if (dataSource == nil) {
|
||||
OWSFailDebug(@"error: %@", error);
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
|
||||
@ -442,7 +442,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
_Nullable id<DataSource> dataSource = [DataSourcePath dataSourceWithFilePath:filePath
|
||||
shouldDeleteOnDeallocation:NO
|
||||
error:&error];
|
||||
if (error != nil) {
|
||||
if (dataSource == nil) {
|
||||
OWSFailDebug(@"error while creating data source: %@", error);
|
||||
failure();
|
||||
return;
|
||||
@ -1767,7 +1767,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
_Nullable id<DataSource> dataSource = [DataSourcePath dataSourceWithFilePath:filePath
|
||||
shouldDeleteOnDeallocation:NO
|
||||
error:&error];
|
||||
OWSAssertDebug(error == nil);
|
||||
OWSAssertDebug(dataSource != nil);
|
||||
[dataSource setSourceFilename:filename];
|
||||
SignalAttachment *attachment =
|
||||
[SignalAttachment attachmentWithDataSource:dataSource dataUTI:utiType imageQuality:TSImageQualityOriginal];
|
||||
|
||||
@ -240,7 +240,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
_Nullable id<DataSource> dataSource = [DataSourcePath dataSourceWithFilePath:filePath
|
||||
shouldDeleteOnDeallocation:YES
|
||||
error:&error];
|
||||
OWSAssertDebug(error == nil);
|
||||
OWSAssertDebug(dataSource != nil);
|
||||
[dataSource setSourceFilename:fileName];
|
||||
SignalAttachment *attachment = [SignalAttachment attachmentWithDataSource:dataSource dataUTI:utiType];
|
||||
NSData *databasePassword = [OWSPrimaryStorage.sharedManager databasePassword];
|
||||
@ -279,7 +279,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
_Nullable id<DataSource> dataSource = [DataSourcePath dataSourceWithFilePath:filePath
|
||||
shouldDeleteOnDeallocation:YES
|
||||
error:&error];
|
||||
if (error != nil) {
|
||||
if (dataSource == nil) {
|
||||
OWSFailDebug(@"Could not create dataSource: %@.", error);
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user