mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-06-02 19:36:30 +02:00
fix: handle if number string is corrupt or unexpected
This commit is contained in:
parent
91c8f641b6
commit
c4e4d7880c
|
@ -136,7 +136,7 @@ public class SharedPrefCategory {
|
|||
if (value != null) {
|
||||
return Integer.valueOf(value);
|
||||
}
|
||||
} catch (ClassCastException ex) {
|
||||
} catch (ClassCastException | NumberFormatException ex) {
|
||||
try {
|
||||
// Old data previously stored as primitive.
|
||||
return preferences.getInt(key, _default);
|
||||
|
@ -155,7 +155,7 @@ public class SharedPrefCategory {
|
|||
if (value != null) {
|
||||
return Long.valueOf(value);
|
||||
}
|
||||
} catch (ClassCastException ex) {
|
||||
} catch (ClassCastException | NumberFormatException ex) {
|
||||
try {
|
||||
return preferences.getLong(key, _default);
|
||||
} catch (ClassCastException ex2) {
|
||||
|
@ -172,7 +172,7 @@ public class SharedPrefCategory {
|
|||
if (value != null) {
|
||||
return Float.valueOf(value);
|
||||
}
|
||||
} catch (ClassCastException ex) {
|
||||
} catch (ClassCastException | NumberFormatException ex) {
|
||||
try {
|
||||
return preferences.getFloat(key, _default);
|
||||
} catch (ClassCastException ex2) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user