Skip to content

Commit

Permalink
Fix for Kit Initialization & De-Initializationg.
Browse files Browse the repository at this point in the history
Underlying issues is calling fetchConfig when no kit instance is assigned to KitFrameworkManager, therefore the because the instance is null, we cant pass the kits to to apiClient.
Removing empty validation in ConfigManager since this is a valid case.
  • Loading branch information
markvdouw committed Jul 3, 2023
1 parent 49b9066 commit 90d9f66
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,10 @@ void saveConfigJson(JSONObject coreConfig, JSONArray kitConfig, String etag, Str
.putString(Constants.PrefKeys.ETAG, etag)
.putString(Constants.PrefKeys.IF_MODIFIED, lastModified)
.apply();
if (kitConfigString == null || (kitConfigString != null && !kitConfigString.isEmpty())) {
getKitConfigPreferences()
.edit()
.putString(KIT_CONFIG_KEY, kitConfigString)
.apply();
}
getKitConfigPreferences()
.edit()
.putString(KIT_CONFIG_KEY, kitConfigString)
.apply();
} else {
Logger.debug("clearing current configurations");
clearConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public void loadKitLibrary() {
KitManager kitManager = constructor.newInstance(mContext, mReportingManager, mCoreCallbacks, mOptions);
JSONArray configuration = mCoreCallbacks.getLatestKitConfiguration();
Logger.debug("Kit Framework loaded.");
this.mKitManager = kitManager;
if (!MPUtility.isEmpty(configuration)) {
Logger.debug("Restoring previous Kit configuration.");
kitManager
Expand All @@ -81,7 +82,6 @@ public void loadKitLibrary() {
}
);
} else {
mKitManager = kitManager;
updateDataplan(mCoreCallbacks.getDataplanOptions());
}
} catch (Exception e) {
Expand Down

0 comments on commit 90d9f66

Please sign in to comment.