Skip to content

Commit

Permalink
fix storage get
Browse files Browse the repository at this point in the history
  • Loading branch information
Toinane committed May 14, 2024
1 parent d069bf7 commit 96a68c7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,13 @@ let fetch = () =>
*/
let get = (el, name) => {
if (!name) { name = "colorpicker"; }
return storage[name][el] !== null || storage[name][el] !== undefined
? storage[name][el]
: {};
if (storage[name]) {
return storage[name][el] !== null || storage[name][el] !== undefined
? storage[name][el]
: {};
} else {
return {};
}
};

/**
Expand Down

0 comments on commit 96a68c7

Please sign in to comment.