Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
make code more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
jspenguin2017 committed Jul 21, 2019
1 parent d7fdd41 commit 76bb0e5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/js/nano-background.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@ nano.FilterLinter.prototype.lint = function (lintable, ...data) {
// TODO: Some resources are no longer injectable
let token = data[0];

if (!token)
token = "";

const i = token.indexOf(",");

if (i !== -1)
Expand All @@ -327,7 +330,10 @@ nano.FilterLinter.prototype.lint = function (lintable, ...data) {
case nano.flintable.ResRedirect:
{
// TODO: Some resources are no longer redirectable
const token = data[0];
let token = data[0];

if (!token)
token = "";

if (
token !== "none" &&
Expand Down Expand Up @@ -359,6 +365,9 @@ nano.flint = (is_err, key, placeholders) => {

let msg = vAPI.i18n(key);

if (!msg)
msg = "(message not found)";

for (const pair of placeholders)
msg = msg.replace(...pair);

Expand Down

0 comments on commit 76bb0e5

Please sign in to comment.