File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,11 @@ export default class FileParser {
1010 }
1111
1212 parseData ( data ) {
13- if ( typeof data === 'string' && data . includes ( '// ==UserScript==' ) ) {
13+ if (
14+ typeof data === 'string' &&
15+ data . includes ( '// ==UserScript==' ) &&
16+ data . includes ( '// ==/UserScript==' )
17+ ) {
1418 return extractMeta ( data ) ;
1519 }
1620 return data ;
@@ -31,6 +35,7 @@ export default class FileParser {
3135
3236 async getVersion ( data = this . getUpdateData ( ) ) {
3337 const resolvedData = await Promise . resolve ( data ) ;
38+ if ( ! resolvedData ) throw new Error ( 'File not found' , this . #updateURL) ;
3439 const version = this . parseVersion ( resolvedData ) ;
3540 if ( ! version || typeof version !== 'string' ) throw new Error ( 'Version not found' ) ;
3641 return version ;
You can’t perform that action at this time.
0 commit comments