Skip to content

Commit 81d957e

Browse files
committed
add nil check in same api
1 parent 6942e9f commit 81d957e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ios/RCTJMessageModule/RCTJMessageModule.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,8 +1599,8 @@ - (JMSGOptionalContent *)convertDicToJMSGOptionalContent:(NSDictionary *)dic {
15991599
}
16001600

16011601
successCallback(@[@{@"username": user.username,
1602-
@"appKey": user.appKey,
1603-
@"filePath": [user largeAvatarLocalPath]}]);
1602+
@"appKey": user.appKey ?: @"",
1603+
@"filePath": [user largeAvatarLocalPath] ?: @""}]);
16041604
}];
16051605
}];
16061606

@@ -1658,7 +1658,7 @@ - (JMSGOptionalContent *)convertDicToJMSGOptionalContent:(NSDictionary *)dic {
16581658

16591659
JMSGMediaAbstractContent *mediaContent = (JMSGMediaAbstractContent *) message.content;
16601660
successCallback(@[@{@"messageId": message.msgId,
1661-
@"filePath": [mediaContent originMediaLocalPath]}]);
1661+
@"filePath": [mediaContent originMediaLocalPath] ?: @""}]);
16621662
}];
16631663
}
16641664
}];
@@ -1714,7 +1714,7 @@ - (JMSGOptionalContent *)convertDicToJMSGOptionalContent:(NSDictionary *)dic {
17141714

17151715
JMSGMediaAbstractContent *mediaContent = (JMSGMediaAbstractContent *) message.content;
17161716
successCallback(@[@{@"messageId": message.msgId,
1717-
@"filePath": [content thumbImageLocalPath]}]);
1717+
@"filePath": [content thumbImageLocalPath] ?: @""}]);
17181718
}];
17191719
}
17201720
}];
@@ -1772,7 +1772,7 @@ - (JMSGOptionalContent *)convertDicToJMSGOptionalContent:(NSDictionary *)dic {
17721772

17731773
JMSGMediaAbstractContent *mediaContent = (JMSGMediaAbstractContent *) message.content;
17741774
successCallback(@[@{@"messageId": message.msgId,
1775-
@"filePath": [mediaContent originMediaLocalPath]}]);
1775+
@"filePath": [mediaContent originMediaLocalPath] ?: @""}]);
17761776
}];
17771777
}
17781778
}];
@@ -1830,7 +1830,7 @@ - (JMSGOptionalContent *)convertDicToJMSGOptionalContent:(NSDictionary *)dic {
18301830
}
18311831
JMSGFileContent *fileContent = (JMSGFileContent *) message.content;
18321832
successCallback(@[@{@"messageId": message.msgId,
1833-
@"filePath":[fileContent originMediaLocalPath]}]);
1833+
@"filePath":[fileContent originMediaLocalPath] ?: @"" }]);
18341834
}];
18351835
}
18361836
}];
@@ -2319,7 +2319,7 @@ - (JMSGOptionalContent *)convertDicToJMSGOptionalContent:(NSDictionary *)dic {
23192319
return ;
23202320
}
23212321

2322-
successCallback(@[@{@"id": objectId, @"filePath": group.thumbAvatarLocalPath}]);
2322+
successCallback(@[@{@"id": objectId, @"filePath": group.thumbAvatarLocalPath ?: @""}]);
23232323
}];
23242324
}];
23252325
}
@@ -2345,7 +2345,7 @@ - (JMSGOptionalContent *)convertDicToJMSGOptionalContent:(NSDictionary *)dic {
23452345
return ;
23462346
}
23472347

2348-
successCallback(@[@{@"id": objectId, @"filePath": group.largeAvatarLocalPath}]);
2348+
successCallback(@[@{@"id": objectId, @"filePath": group.largeAvatarLocalPath ?: @""}]);
23492349
}];
23502350
}];
23512351
}

0 commit comments

Comments
 (0)