Skip to content

Commit

Permalink
fix(ios): call callback with success no byte event on writeFromBuffer…
Browse files Browse the repository at this point in the history
… with no length
  • Loading branch information
sgtcoolguy committed Jul 16, 2020
1 parent b58349d commit 8a639d8
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -185,6 +185,12 @@ - (NSInteger)writeFromBuffer:(TiBuffer *)buffer offset:(NSInteger)offset length:
THROW_IF_HANDLE_NIL(CODELOCATION);

if (length == 0) {
if (callback != nil) {
NSMutableDictionary *event = [TiUtils dictionaryWithCode:0 message:nil];
[event setObject:self forKey:@"source"];
[event setObject:NUMUINTEGER(0) forKey:@"bytesProcessed"];
[self _fireEventToListener:@"write" withObject:event listener:callback thisObject:nil];
}
return 0; // NO-OP
}

Expand Down

0 comments on commit 8a639d8

Please sign in to comment.