mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-12-01 08:12:55 +01:00
refactor: early return in saveValue
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
parent
eea37a9bad
commit
915b8d371a
@ -103,16 +103,17 @@ public enum SettingsEnum {
|
||||
|
||||
public void saveValue(Object newValue) {
|
||||
Context context = ReVancedUtils.getAppContext();
|
||||
if (context != null) {
|
||||
if (context == null) {
|
||||
LogHelper.printException(SettingsEnum.class, "Context on SaveValue is null!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (returnType == ReturnType.BOOLEAN) {
|
||||
SharedPrefHelper.saveBoolean(context, sharedPref, path, (Boolean) newValue);
|
||||
} else {
|
||||
SharedPrefHelper.saveString(context, sharedPref, path, newValue + "");
|
||||
}
|
||||
value = newValue;
|
||||
} else {
|
||||
LogHelper.printException(SettingsEnum.class, "Context on SaveValue is null!");
|
||||
}
|
||||
}
|
||||
|
||||
public int getInt() {
|
||||
|
Loading…
Reference in New Issue
Block a user