mirror of
https://github.com/revanced/revanced-integrations.git
synced 2025-05-14 20:47:06 +02: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) {
|
public void saveValue(Object newValue) {
|
||||||
Context context = ReVancedUtils.getAppContext();
|
Context context = ReVancedUtils.getAppContext();
|
||||||
if (context != null) {
|
if (context == null) {
|
||||||
|
LogHelper.printException(SettingsEnum.class, "Context on SaveValue is null!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (returnType == ReturnType.BOOLEAN) {
|
if (returnType == ReturnType.BOOLEAN) {
|
||||||
SharedPrefHelper.saveBoolean(context, sharedPref, path, (Boolean) newValue);
|
SharedPrefHelper.saveBoolean(context, sharedPref, path, (Boolean) newValue);
|
||||||
} else {
|
} else {
|
||||||
SharedPrefHelper.saveString(context, sharedPref, path, newValue + "");
|
SharedPrefHelper.saveString(context, sharedPref, path, newValue + "");
|
||||||
}
|
}
|
||||||
value = newValue;
|
value = newValue;
|
||||||
} else {
|
|
||||||
LogHelper.printException(SettingsEnum.class, "Context on SaveValue is null!");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getInt() {
|
public int getInt() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user