From 8046dda5dc28c4cfd2473f3e75fdff426338d336 Mon Sep 17 00:00:00 2001 From: zapcannon87 Date: Fri, 29 Apr 2022 19:02:27 +0800 Subject: [PATCH 1/2] fix(message): type checking --- AVOS/Sources/Realtime/IM/Message/LCIMMessage.m | 4 ++++ AVOS/Sources/Realtime/IM/TypedMessages/LCIMTypedMessage.m | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/AVOS/Sources/Realtime/IM/Message/LCIMMessage.m b/AVOS/Sources/Realtime/IM/Message/LCIMMessage.m index 371c0a51..db807938 100644 --- a/AVOS/Sources/Realtime/IM/Message/LCIMMessage.m +++ b/AVOS/Sources/Realtime/IM/Message/LCIMMessage.m @@ -28,6 +28,10 @@ @implementation LCIMMessagePatchedReason @implementation LCIMMessage + (instancetype)messageWithContent:(NSString *)content { + if (content && ![NSString _lc_isTypeOf:content]) { + [NSException raise:NSInvalidArgumentException + format:@"The type of content is not `NSString`."]; + } LCIMMessage *message = [[self alloc] init]; message.content = content; return message; diff --git a/AVOS/Sources/Realtime/IM/TypedMessages/LCIMTypedMessage.m b/AVOS/Sources/Realtime/IM/TypedMessages/LCIMTypedMessage.m index 4e7a45ef..c3d3c600 100644 --- a/AVOS/Sources/Realtime/IM/TypedMessages/LCIMTypedMessage.m +++ b/AVOS/Sources/Realtime/IM/TypedMessages/LCIMTypedMessage.m @@ -174,6 +174,10 @@ - (NSString *)text - (void)setText:(NSString *)text { + if (text && ![NSString _lc_isTypeOf:text]) { + [NSException raise:NSInvalidArgumentException + format:@"The type of text is not `NSString`."]; + } self.messageObject._lctext = text; } From 321172af9d2c5765925c27e07e32d3f31e3b7588 Mon Sep 17 00:00:00 2001 From: zapcannon87 Date: Fri, 29 Apr 2022 19:04:34 +0800 Subject: [PATCH 2/2] release: 13.7.1 --- AVOS/Sources/Foundation/UserAgent.h | 2 +- LeanCloudObjc.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/AVOS/Sources/Foundation/UserAgent.h b/AVOS/Sources/Foundation/UserAgent.h index 70b8eb27..e1c91dd8 100644 --- a/AVOS/Sources/Foundation/UserAgent.h +++ b/AVOS/Sources/Foundation/UserAgent.h @@ -1 +1 @@ -#define SDK_VERSION @"13.7.0" +#define SDK_VERSION @"13.7.1" diff --git a/LeanCloudObjc.podspec b/LeanCloudObjc.podspec index 1ab604e5..fdc76e84 100644 --- a/LeanCloudObjc.podspec +++ b/LeanCloudObjc.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'LeanCloudObjc' - s.version = '13.7.0' + s.version = '13.7.1' s.homepage = 'https://leancloud.cn/' s.summary = 'LeanCloud Objective-C SDK' s.authors = 'LeanCloud'