react-native-gleapsdk 14.8.0 → 14.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,6 +10,11 @@ import org.json.JSONObject;
10
10
 
11
11
  public class GleapUtil {
12
12
  protected static JSONObject convertMapToJson(ReadableMap readableMap) throws JSONException {
13
+ // Handle null ReadableMap to prevent NullPointerException
14
+ if (readableMap == null) {
15
+ return new JSONObject();
16
+ }
17
+
13
18
  JSONObject object = new JSONObject();
14
19
  ReadableMapKeySetIterator iterator = readableMap.keySetIterator();
15
20
  while (iterator.hasNextKey()) {
@@ -39,6 +44,11 @@ public class GleapUtil {
39
44
  }
40
45
 
41
46
  protected static JSONArray convertArrayToJson(ReadableArray readableArray) throws JSONException {
47
+ // Handle null ReadableArray to prevent NullPointerException
48
+ if (readableArray == null) {
49
+ return new JSONArray();
50
+ }
51
+
42
52
  JSONArray array = new JSONArray();
43
53
  for (int i = 0; i < readableArray.size(); i++) {
44
54
  switch (readableArray.getType(i)) {
@@ -980,7 +980,11 @@ public class GleapsdkModule extends ReactContextBaseJavaModule {
980
980
  try {
981
981
  String[] networkLogBlacklistArray = new String[networkLogBlacklist.size()];
982
982
  for (int i = 0; i < networkLogBlacklist.size(); i++) {
983
- networkLogBlacklistArray[i] = networkLogBlacklist.getString(i);
983
+ try {
984
+ networkLogBlacklistArray[i] = networkLogBlacklist.getString(i);
985
+ } catch (Exception e) {
986
+ e.printStackTrace();
987
+ }
984
988
  }
985
989
  Gleap.getInstance().setNetworkLogsBlacklist(networkLogBlacklistArray);
986
990
  } catch (Exception ex) {
@@ -998,7 +1002,11 @@ public class GleapsdkModule extends ReactContextBaseJavaModule {
998
1002
  try {
999
1003
  String[] networkLogPropsToIgnoreArray = new String[networkLogPropsToIgnore.size()];
1000
1004
  for (int i = 0; i < networkLogPropsToIgnore.size(); i++) {
1001
- networkLogPropsToIgnoreArray[i] = networkLogPropsToIgnore.getString(i);
1005
+ try {
1006
+ networkLogPropsToIgnoreArray[i] = networkLogPropsToIgnore.getString(i);
1007
+ } catch (Exception e) {
1008
+ e.printStackTrace();
1009
+ }
1002
1010
  }
1003
1011
  Gleap.getInstance().setNetworkLogPropsToIgnore(networkLogPropsToIgnoreArray);
1004
1012
  } catch (Exception ex) {
@@ -1016,7 +1024,11 @@ public class GleapsdkModule extends ReactContextBaseJavaModule {
1016
1024
  try {
1017
1025
  String[] tagsArray = new String[tags.size()];
1018
1026
  for (int i = 0; i < tags.size(); i++) {
1019
- tagsArray[i] = tags.getString(i);
1027
+ try {
1028
+ tagsArray[i] = tags.getString(i);
1029
+ } catch (Exception e) {
1030
+ e.printStackTrace();
1031
+ }
1020
1032
  }
1021
1033
  Gleap.getInstance().setTags(tagsArray);
1022
1034
  } catch (Exception ex) {
@@ -1037,7 +1049,7 @@ public class GleapsdkModule extends ReactContextBaseJavaModule {
1037
1049
  try {
1038
1050
  jsonObject = GleapUtil.convertMapToJson(data);
1039
1051
  Gleap.getInstance().trackEvent(name, jsonObject);
1040
- } catch (JSONException e) {
1052
+ } catch (Exception e) {
1041
1053
  e.printStackTrace();
1042
1054
  }
1043
1055
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-gleapsdk",
3
- "version": "14.8.0",
3
+ "version": "14.8.1",
4
4
  "description": "Know exactly why and how a bug happened. Get reports with screenshots, live action replays and all of the important metadata every time.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",