We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f424b15 commit d0adcd3Copy full SHA for d0adcd3
1 file changed
src/utils/parser/FileParser.js
@@ -10,7 +10,11 @@ export default class FileParser {
10
}
11
12
parseData(data) {
13
- if (typeof data === 'string' && data.includes('// ==UserScript==')) {
+ if (
14
+ typeof data === 'string' &&
15
+ data.includes('// ==UserScript==') &&
16
+ data.includes('// ==/UserScript==')
17
+ ) {
18
return extractMeta(data);
19
20
return data;
@@ -31,6 +35,7 @@ export default class FileParser {
31
35
32
36
async getVersion(data = this.getUpdateData()) {
33
37
const resolvedData = await Promise.resolve(data);
38
+ if (!resolvedData) throw new Error('File not found', this.#updateURL);
34
39
const version = this.parseVersion(resolvedData);
40
if (!version || typeof version !== 'string') throw new Error('Version not found');
41
return version;
0 commit comments