Skip to content

Commit

Permalink
Merge pull request #689 from zapcannon87/master
Browse files Browse the repository at this point in the history
fix(message): type checking
  • Loading branch information
zapcannon87 authored Apr 29, 2022
2 parents 826b95c + 321172a commit 65bea5e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion AVOS/Sources/Foundation/UserAgent.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define SDK_VERSION @"13.7.0"
#define SDK_VERSION @"13.7.1"
4 changes: 4 additions & 0 deletions AVOS/Sources/Realtime/IM/Message/LCIMMessage.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions AVOS/Sources/Realtime/IM/TypedMessages/LCIMTypedMessage.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion LeanCloudObjc.podspec
Original file line number Diff line number Diff line change
@@ -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'
Expand Down

0 comments on commit 65bea5e

Please sign in to comment.