Skip to content

Commit c01395e

Browse files
committed
Add defensive code for getUsetAttribute
1 parent 475d8ba commit c01395e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ios/RNInstabug/InstabugReactBridge.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,11 @@ - (dispatch_queue_t)methodQueue {
252252
}
253253

254254
RCT_EXPORT_METHOD(getUserAttribute:(NSString *)key callback:(RCTResponseSenderBlock)callback) {
255+
@try {
255256
callback(@[[Instabug userAttributeForKey:key]]);
257+
} @catch (NSException *exception) {
258+
callback(nil);
259+
}
256260
}
257261

258262
RCT_EXPORT_METHOD(removeUserAttribute:(NSString *)key) {

0 commit comments

Comments
 (0)