Skip to content

Commit

Permalink
修复iOS/OSX平台下function中返回元组带有nil时发生异常问题
Browse files Browse the repository at this point in the history
  • Loading branch information
vimfung committed Nov 5, 2019
1 parent 39019dc commit 601dc24
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Source/iOS_OSX/Code/LSCTuple.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,18 @@ - (NSInteger)count

- (void)addReturnValue:(id)returnValue
{
if (!returnValue)
{
returnValue = [NSNull null];
}

[self.returnValues addObject:returnValue];
}

- (id)returnValueForIndex:(NSInteger)index
{
return self.returnValues[index];
id retVal = self.returnValues[index];
return [retVal isKindOfClass:[NSNull class]] ? nil : retVal;
}

- (NSString *)description
Expand Down

0 comments on commit 601dc24

Please sign in to comment.