fix error check

This commit is contained in:
r4 2022-10-01 19:59:34 +02:00
parent c8f9832f48
commit 154c6a31b9
1 changed files with 2 additions and 2 deletions

View File

@ -140,7 +140,7 @@ func getDecryptFunction(baseJs string) (string, error) {
} }
fn := baseJs[start+len(startMatch):] fn := baseJs[start+len(startMatch):]
end := strings.Index(fn, endMatch) end := strings.Index(fn, endMatch)
if start == -1 { if end == -1 {
return "", ErrDecryptGettingFunction return "", ErrDecryptGettingFunction
} }
return fn[:end], nil return fn[:end], nil
@ -170,7 +170,7 @@ func getDecryptOps(baseJs string) ([]decryptorOp, error) {
} }
ops = baseJs[start+len(startMatch):] ops = baseJs[start+len(startMatch):]
end := strings.Index(ops, endMatch) end := strings.Index(ops, endMatch)
if start == -1 { if end == -1 {
return nil, ErrDecryptGettingOpTable return nil, ErrDecryptGettingOpTable
} }
ops = ops[:end] ops = ops[:end]