Skip to content

Commit

Permalink
Ensure feature flag is string before cast.
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-signal authored and cody-signal committed Sep 4, 2020
1 parent 250402e commit d625740
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,10 @@ private static int getInteger(@NonNull String key, int defaultValue) {
return forced;
}

String remote = (String) REMOTE_VALUES.get(key);
if (remote != null) {
Object remote = REMOTE_VALUES.get(key);
if (remote instanceof String) {
try {
return Integer.parseInt(remote);
return Integer.parseInt((String) remote);
} catch (NumberFormatException e) {
Log.w(TAG, "Expected an int for key '" + key + "', but got something else! Falling back to the default.");
}
Expand Down

0 comments on commit d625740

Please sign in to comment.