Skip to content

Commit

Permalink
Remove extra calls to readDataToEndOfFile that were causing exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
ksuther authored and tiennou committed Feb 13, 2018
1 parent 0943934 commit 85909e5
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions Classes/Util/PBTask.m
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ - (void)performTaskOnQueue:(dispatch_queue_t)queue terminationHandler:(void (^)(

PBTaskLog(@"task %p: exit != 0", weakSelf);

[(NSMutableData *)weakSelf.standardOutputData appendData:[[task.standardOutput fileHandleForReading] readDataToEndOfFile]];
NSString *outputString = [[NSString alloc] initWithData:weakSelf.standardOutputData encoding:NSUTF8StringEncoding];
weakSelf.standardOutputData = nil;

Expand Down Expand Up @@ -189,7 +188,6 @@ - (void)performTaskOnQueue:(dispatch_queue_t)queue completionHandler:(void (^)(N
@synchronized (self) {
PBTaskLog(@"task %p: completed, removing read handler", self);
[self.task.standardOutput fileHandleForReading].readabilityHandler = nil;
[(NSMutableData *)self.standardOutputData appendData:[[self.task.standardOutput fileHandleForReading] readDataToEndOfFile]];
}

completionHandler(self.standardOutputData, nil);
Expand Down

0 comments on commit 85909e5

Please # to comment.