error handling with local Storage
This commit is contained in:
parent
a9cad34e71
commit
fbbd126cd6
|
@ -119,12 +119,20 @@
|
||||||
|
|
||||||
<script src="js/functions.js"></script>
|
<script src="js/functions.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
try {
|
||||||
closedTopics = JSON.parse(localStorage.getItem("closedTopics"))
|
closedTopics = JSON.parse(localStorage.getItem("closedTopics"))
|
||||||
|
} catch (e) {
|
||||||
|
closedTopics = []
|
||||||
|
}
|
||||||
if(!closedTopics) {
|
if(!closedTopics) {
|
||||||
closedTopics = []
|
closedTopics = []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try{
|
||||||
actualTopic = JSON.parse(localStorage.getItem("actualTopic"))
|
actualTopic = JSON.parse(localStorage.getItem("actualTopic"))
|
||||||
|
} catch (e) {
|
||||||
|
initializeNewTopic()
|
||||||
|
}
|
||||||
if(!actualTopic) {
|
if(!actualTopic) {
|
||||||
initializeNewTopic()
|
initializeNewTopic()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue