diff --git a/android-core/src/main/java/com/mparticle/internal/DeviceAttributes.java b/android-core/src/main/java/com/mparticle/internal/DeviceAttributes.java index 707683e22..7948a3f4f 100644 --- a/android-core/src/main/java/com/mparticle/internal/DeviceAttributes.java +++ b/android-core/src/main/java/com/mparticle/internal/DeviceAttributes.java @@ -47,19 +47,24 @@ public static String getDeviceImei() { } private int getSideloadedKitsCount() { - Set kits = MParticle.getInstance().Internal().getKitManager().getSupportedKits(); - int count = 0; - for (Integer kitId : kits) { - if (kitId >= 1000000) { - count++; + try { + Set kits = MParticle.getInstance().Internal().getKitManager().getSupportedKits(); + int count = 0; + for (Integer kitId : kits) { + if (kitId >= 1000000) { + count++; + } } + return count; + } catch (Exception e) { + Logger.debug("Exception while adding sideloadedKitsCount to Device Attribute"); + return 0; } - return count; } /** * Generates a collection of application attributes that will not change during an app's process. - * + *

* This contains logic that MUST only be called once per app run. * * @param appContext the application context @@ -170,7 +175,7 @@ public static void addAndroidId(JSONObject attributes, Context context) throws J /** * Generates a collection of device attributes that will not change during an app's process. - * + *

* This contains logic that MUST only be called once per app run. * * @param appContext the application context