Skip to content

Commit

Permalink
fix(application-settings-android): possible uninitialized sharedPrefe…
Browse files Browse the repository at this point in the history
…rences variable usage (#7813)
  • Loading branch information
ycherniavskyi authored and manoldonev committed Sep 13, 2019
1 parent 0b3ceb0 commit 4f421ff
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,13 @@ export function clear(): void {
}

export function flush(): boolean {
ensureSharedPreferences();

return sharedPreferences.edit().commit();
}

export function getAllKeys(): Array<string> {
ensureSharedPreferences();
const mappedPreferences = sharedPreferences.getAll();
const iterator = mappedPreferences.keySet().iterator();
const result = [];
Expand Down

0 comments on commit 4f421ff

Please sign in to comment.