diff options
Diffstat (limited to 'apps/Player')
-rw-r--r-- | apps/Player/components/App.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/Player/components/App.js b/apps/Player/components/App.js index 5879111..f7b0557 100644 --- a/apps/Player/components/App.js +++ b/apps/Player/components/App.js @@ -28,7 +28,12 @@ const App = ({ list }) => { } } else { if (typeof window !== 'undefined') { - setPlaylist(JSON.parse(window.localStorage.getItem('playlist'))) + try { + setPlaylist(JSON.parse(window.localStorage.getItem('playlist'))) + } catch (e) { + setPlaylist([]) + window.localStorage.setItem('playlist', JSON.stringify([])) + } } } }, [list]) |