mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(application-settings-android): possible uninitialized sharedPreferences variable usage (#7813)
This commit is contained in:
committed by
Manol Donev
parent
0b3ceb0e7c
commit
4f421ffbfe
@@ -85,10 +85,13 @@ export function clear(): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function flush(): boolean {
|
export function flush(): boolean {
|
||||||
|
ensureSharedPreferences();
|
||||||
|
|
||||||
return sharedPreferences.edit().commit();
|
return sharedPreferences.edit().commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getAllKeys(): Array<string> {
|
export function getAllKeys(): Array<string> {
|
||||||
|
ensureSharedPreferences();
|
||||||
const mappedPreferences = sharedPreferences.getAll();
|
const mappedPreferences = sharedPreferences.getAll();
|
||||||
const iterator = mappedPreferences.keySet().iterator();
|
const iterator = mappedPreferences.keySet().iterator();
|
||||||
const result = [];
|
const result = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user