Skip to content

Commit 6f8c16b

Browse files
author
Ali Abdelfattah
authored
Merge pull request #461 from Instabug/custom/view-hierarchy-crash
Add defensive code for hideView API [INSD-3722]
2 parents 6ec478b + 132d0cf commit 6f8c16b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ android {
2929
dependencies {
3030
implementation 'com.android.support:multidex:1.0.3'
3131
implementation 'com.facebook.react:react-native:+'
32-
api('com.instabug.library:instabug:9.0.5.0') {
32+
api('com.instabug.library:instabug:9.0.5.3') {
3333
exclude group: 'com.android.support:appcompat-v7'
3434
}
3535
testImplementation 'org.mockito:mockito-core:1.10.19'

android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2234,7 +2234,11 @@ public void execute(NativeViewHierarchyManager nativeViewHierarchyManager) {
22342234
final View[] arrayOfViews = new View[ids.size()];
22352235
for (int i = 0; i < ids.size(); i++) {
22362236
int viewId = (int) ids.getDouble(i);
2237-
arrayOfViews[i] = nativeViewHierarchyManager.resolveView(viewId);
2237+
try {
2238+
arrayOfViews[i] = nativeViewHierarchyManager.resolveView(viewId);
2239+
} catch(Exception e) {
2240+
e.printStackTrace();
2241+
}
22382242
}
22392243
Instabug.setViewsAsPrivate(arrayOfViews);
22402244
}

0 commit comments

Comments
 (0)