Merge pull request #2370 from zhongwuzw/fix_nullable

Fix HTTP Header key field nullable
This commit is contained in:
DreamPiggy 2018-07-06 00:00:47 +08:00 committed by GitHub
commit 3dad550180
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -57,12 +57,14 @@
Default is YES. Set to NO to only render the static poster for incremental animated image. Default is YES. Set to NO to only render the static poster for incremental animated image.
*/ */
@property (nonatomic, assign) BOOL shouldIncrementalLoad; @property (nonatomic, assign) BOOL shouldIncrementalLoad;
#if SD_UIKIT
/** /**
You can specify a runloop mode to let it rendering. You can specify a runloop mode to let it rendering.
Default is NSRunLoopCommonModes on multi-core iOS device, NSDefaultRunLoopMode on single-core iOS device Default is NSRunLoopCommonModes on multi-core iOS device, NSDefaultRunLoopMode on single-core iOS device
*/ */
@property (nonatomic, copy, nonnull) NSRunLoopMode runLoopMode NS_AVAILABLE_IOS(3_1); @property (nonatomic, copy, nonnull) NSRunLoopMode runLoopMode;
#endif
@end @end
#endif #endif

View File

@ -133,6 +133,9 @@ static void * SDWebImageDownloaderContext = &SDWebImageDownloaderContext;
} }
- (void)setValue:(nullable NSString *)value forHTTPHeaderField:(nullable NSString *)field { - (void)setValue:(nullable NSString *)value forHTTPHeaderField:(nullable NSString *)field {
if (!field) {
return;
}
NSMutableDictionary *mutableHTTPHeaders = [self.HTTPHeaders mutableCopy]; NSMutableDictionary *mutableHTTPHeaders = [self.HTTPHeaders mutableCopy];
if (value) { if (value) {
[mutableHTTPHeaders setObject:value forKey:field]; [mutableHTTPHeaders setObject:value forKey:field];