File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff 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;
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments