Skip to content

Commit

Permalink
Fixed Xcode 16 arosed analyser warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
maratal committed Sep 17, 2024
1 parent dd9a08a commit 75e9554
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Source/ARTDataEncoder.m
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ - (ARTDataEncoderOutput *)encode:(id)data {
encoded = [data dataUsingEncoding:NSUTF8StringEncoding];
encoding = [NSString artAddEncoding:@"utf-8" toString:encoding];
}
if (encoded == nil) {
return [[ARTDataEncoderOutput alloc] initWithData:data encoding:nil errorInfo:[ARTErrorInfo createWithCode:0 message:@"must be NSString, NSData, NSArray or NSDictionary."]];
}
ARTStatus *status = [_cipher encrypt:encoded output:&toBase64];
if (status.state != ARTStateOk) {
ARTErrorInfo *errorInfo = status.errorInfo ? status.errorInfo : [ARTErrorInfo createWithCode:0 message:@"encrypt failed"];
Expand Down Expand Up @@ -181,7 +184,7 @@ - (ARTDataEncoderOutput *)decode:(id)data identifier:(NSString *)identifier enco
if (status.state != ARTStateOk) {
errorInfo = status.errorInfo ? status.errorInfo : [ARTErrorInfo createWithCode:ARTErrorInvalidMessageDataOrEncoding message:@"decrypt failed"];
}
} else if ([encoding isEqualToString:@"vcdiff"] && _deltaCodec) {
} else if ([encoding isEqualToString:@"vcdiff"] && _deltaCodec && [data isKindOfClass:[NSData class]]) {
NSError *decodeError;
data = [_deltaCodec applyDelta:data deltaId:identifier baseId:_baseId error:&decodeError];

Expand Down

0 comments on commit 75e9554

Please sign in to comment.