Skip to content

Commit

Permalink
security measure against deformed save data
Browse files Browse the repository at this point in the history
  • Loading branch information
FallBackITA27 committed May 14, 2024
1 parent b9fdc92 commit edf8a33
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions gtav-interactive-map/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,16 @@ let saveData = {
}
}

let temporarySaveData = localStorage.getItem("saveData");
if (temporarySaveData != null) saveData = JSON.parse(temporarySaveData);
let temporarySaveDataStr = localStorage.getItem("saveData");
if (temporarySaveDataStr != null) {
let temporarySaveData = JSON.parse(temporarySaveDataStr);
for (key in saveData.profile0) {
temporarySaveData.profile0[key] === null;
temporarySaveData.profile0[key] = saveData.profile0[key];
}
saveData = temporarySaveData;

}
saveDataSave();

let map = L.map('map', {
Expand Down

0 comments on commit edf8a33

Please sign in to comment.