Fix NPE check

closes #131
This commit is contained in:
FireMasterK 2021-04-21 19:08:50 +05:30
parent 79e2680c18
commit a082b508eb
No known key found for this signature in database
GPG key ID: 8DFF5DD33E93DB58
2 changed files with 2 additions and 2 deletions

View file

@ -104,7 +104,7 @@ export default {
this.selectedInstance = localStorage.getItem("instance") || "https://pipedapi.kavin.rocks"; this.selectedInstance = localStorage.getItem("instance") || "https://pipedapi.kavin.rocks";
this.sponsorBlock = localStorage.getItem("sponsorblock") || true; this.sponsorBlock = localStorage.getItem("sponsorblock") || true;
if (localStorage.getItem("selectedSkip")) { if (localStorage.getItem("selectedSkip") !== null) {
var skipList = localStorage.getItem("selectedSkip").split(","); var skipList = localStorage.getItem("selectedSkip").split(",");
this.skipSponsor = this.skipIntro = this.skipOutro = this.skipInteraction = this.skipSelfPromo = this.skipMusicOffTopic = false; this.skipSponsor = this.skipIntro = this.skipOutro = this.skipInteraction = this.skipSelfPromo = this.skipMusicOffTopic = false;
skipList.forEach(skip => { skipList.forEach(skip => {

View file

@ -93,7 +93,7 @@ export default {
"/sponsors/" + "/sponsors/" +
this.$route.query.v + this.$route.query.v +
"?category=" + "?category=" +
(localStorage && localStorage.getItem("selectedSkip") (localStorage && localStorage.getItem("selectedSkip") !== null
? encodeURIComponent('["' + localStorage.getItem("selectedSkip").replace(",", '","') + '"]') ? encodeURIComponent('["' + localStorage.getItem("selectedSkip").replace(",", '","') + '"]')
: encodeURIComponent('["sponsor", "interaction", "selfpromo", "music_offtopic"]')), : encodeURIComponent('["sponsor", "interaction", "selfpromo", "music_offtopic"]')),
); );