[Issue #368] Checking for non-zero data length before attempting to append to write to output stream in multipart form data builder
This commit is contained in:
parent
d7852c19e1
commit
286b8100c5
1 changed files with 4 additions and 0 deletions
|
|
@ -837,6 +837,10 @@ static inline NSString * AFMultipartFormFinalBoundary() {
|
|||
}
|
||||
|
||||
- (void)appendData:(NSData *)data {
|
||||
if ([data length] == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ([self.outputStream hasSpaceAvailable]) {
|
||||
const uint8_t *dataBuffer = (uint8_t *) [data bytes];
|
||||
[self.outputStream write:&dataBuffer[0] maxLength:[data length]];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue