Ensure feature flag is string before cast.

This commit is contained in:
Alan Evans
2020-09-02 12:08:20 -03:00
committed by Cody Henthorne
parent 250402e9b9
commit d625740ca4

View File

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