Page MenuHomePhabricator

D9248.id31322.diff
No OneTemporary

D9248.id31322.diff

diff --git a/native/ios/NotificationService/NotificationService.mm b/native/ios/NotificationService/NotificationService.mm
--- a/native/ios/NotificationService/NotificationService.mm
+++ b/native/ios/NotificationService/NotificationService.mm
@@ -59,20 +59,31 @@
// Step 1: notification decryption.
if ([self shouldBeDecrypted:content.userInfo]) {
+ std::optional<std::string> notifID;
+ NSString *objcNotifID = content.userInfo[@"id"];
+ if (objcNotifID) {
+ notifID = std::string([objcNotifID UTF8String]);
+ }
+
std::string decryptErrorMessage;
- std::string notifID = std::string([content.userInfo[@"id"] UTF8String]);
try {
@try {
[self decryptContentInPlace:content];
} @catch (NSException *e) {
decryptErrorMessage = "NSE: Received Obj-C exception: " +
std::string([e.name UTF8String]) +
- " during notification decryption. Notif ID: " + notifID;
+ " during notification decryption.";
+ if (notifID.has_value()) {
+ decryptErrorMessage += " Notif ID: " + notifID.value();
+ }
}
} catch (const std::exception &e) {
decryptErrorMessage =
"NSE: Received C++ exception: " + std::string(e.what()) +
- " during notification decryption. Notif ID: " + notifID;
+ " during notification decryption.";
+ if (notifID.has_value()) {
+ decryptErrorMessage += " Notif ID: " + notifID.value();
+ }
}
if (decryptErrorMessage.size()) {

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 9, 8:18 AM (19 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2450802
Default Alt Text
D9248.id31322.diff (1 KB)

Event Timeline