Skip to content

Commit 65bea5e

Browse files
authored
Merge pull request #689 from zapcannon87/master
fix(message): type checking
2 parents 826b95c + 321172a commit 65bea5e

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#define SDK_VERSION @"13.7.0"
1+
#define SDK_VERSION @"13.7.1"

AVOS/Sources/Realtime/IM/Message/LCIMMessage.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ @implementation LCIMMessagePatchedReason
2828
@implementation LCIMMessage
2929

3030
+ (instancetype)messageWithContent:(NSString *)content {
31+
if (content && ![NSString _lc_isTypeOf:content]) {
32+
[NSException raise:NSInvalidArgumentException
33+
format:@"The type of content is not `NSString`."];
34+
}
3135
LCIMMessage *message = [[self alloc] init];
3236
message.content = content;
3337
return message;

AVOS/Sources/Realtime/IM/TypedMessages/LCIMTypedMessage.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ - (NSString *)text
174174

175175
- (void)setText:(NSString *)text
176176
{
177+
if (text && ![NSString _lc_isTypeOf:text]) {
178+
[NSException raise:NSInvalidArgumentException
179+
format:@"The type of text is not `NSString`."];
180+
}
177181
self.messageObject._lctext = text;
178182
}
179183

LeanCloudObjc.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'LeanCloudObjc'
3-
s.version = '13.7.0'
3+
s.version = '13.7.1'
44
s.homepage = 'https://leancloud.cn/'
55
s.summary = 'LeanCloud Objective-C SDK'
66
s.authors = 'LeanCloud'

0 commit comments

Comments
 (0)