We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ad13b37 commit 9a69e97Copy full SHA for 9a69e97
Classes/Util/PBEasyPipe.m
@@ -36,8 +36,12 @@ - (void)setDataOutput:(nonnull NSMutableData *)dataOutput {
36
NSAssert(fileHandle != nil, @"should have file handle for reading");
37
38
fileHandle.readabilityHandler = ^(NSFileHandle * _Nonnull fileHandle) {
39
- [dataOutput appendData:fileHandle.availableData];
40
- [fileHandle closeFile];
+ NSData *data = fileHandle.availableData;
+ if (data.length) {
41
+ [dataOutput appendData:data];
42
+ } else {
43
+ [fileHandle closeFile];
44
+ }
45
};
46
}
47
0 commit comments