Skip to content

Commit 4b35407

Browse files
committed
Add defensive coding to network logger call
1 parent 475d8ba commit 4b35407

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

modules/NetworkLogger.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,14 @@ export default {
2929
network
3030
);
3131
} else {
32-
if (Platform.OS === 'android') {
33-
Instabug.networkLog(JSON.stringify(network));
34-
} else {
35-
Instabug.networkLog(network);
32+
try {
33+
if (Platform.OS === 'android') {
34+
Instabug.networkLog(JSON.stringify(network));
35+
} else {
36+
Instabug.networkLog(network);
37+
}
38+
} catch (e) {
39+
console.error(e);
3640
}
3741
}
3842
}

0 commit comments

Comments
 (0)