Skip to content

Commit

Permalink
fix nullpointer exception in UserSettingsManager
Browse files Browse the repository at this point in the history
Summary:
crash reported when response is null
setting it to the fallback value instead of crashing out

Reviewed By: YOUDAN, KylinChang

Differential Revision: D13815342

fbshipit-source-id: 6f58911ab38b7a9c38a614eb10a3f1bda069c4cd
  • Loading branch information
fbtaoge authored and facebook-github-bot committed Jan 25, 2019
1 parent dff7f22 commit 66d9c62
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,12 @@ public void run() {
codelessRequest.setSkipClientToken(true);
codelessRequest.setParameters(codelessSettingsParams);
JSONObject response = codelessRequest.executeAndWait().getJSONObject();
codelessSetupEnabled.value =
response.optBoolean(EVENTS_CODELESS_SETUP_ENABLED, false);
codelessSetupEnabled.lastTS = currTime;
writeSettingToCache(codelessSetupEnabled);
if (response != null) {
codelessSetupEnabled.value =
response.optBoolean(EVENTS_CODELESS_SETUP_ENABLED, false);
codelessSetupEnabled.lastTS = currTime;
writeSettingToCache(codelessSetupEnabled);
}
}
}
}
Expand Down

0 comments on commit 66d9c62

Please sign in to comment.