weizhenye / ass-compiler

Parses and compiles ASS subtitle format to easy-to-use data structure
https://ass.js.org/ass-compiler/
MIT License
107 stars 18 forks source link

TypeError: Cannot read property '1' of null #6

Closed Deathspike closed 3 years ago

Deathspike commented 3 years ago

I encountered the following error parsing an .ass file:

(node:19260) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '1' of null
    at parseTag (C:\Users\Deathspike\AppData\Roaming\npm\node_modules\normalize-ssa\node_modules\ass-compiler\dist\ass-compiler.js:79:22)
    at Array.map (<anonymous>)
    at parseTags (C:\Users\Deathspike\AppData\Roaming\npm\node_modules\normalize-ssa\node_modules\ass-compiler\dist\ass-compiler.js:172:17)
    at parseText (C:\Users\Deathspike\AppData\Roaming\npm\node_modules\normalize-ssa\node_modules\ass-compiler\dist\ass-compiler.js:182:18)
    at parseDialogue (C:\Users\Deathspike\AppData\Roaming\npm\node_modules\normalize-ssa\node_modules\ass-compiler\dist\ass-compiler.js:229:22)
    at Object.parse (C:\Users\Deathspike\AppData\Roaming\npm\node_modules\normalize-ssa\node_modules\ass-compiler\dist\ass-compiler.js:315:49)
    at Object.parseSubAsync (C:\Users\Deathspike\AppData\Roaming\npm\node_modules\normalize-ssa\dist\parsers\parseSub.js:27:26)

This occurred on the following line in the .ass:

Comment: 0,0:02:26.00,0:02:28.12,Sign,,0,0,0,,{Cell phone display}{Top line, near battery:}No signal{Third line, after "To":}Kojou-kun{Yellow popup title:}There was an error while attempting to send.{Yellow popup body:}There was an error while attempting to send your photo. There is a problem with the server or network, or your device may have been left idling for too long.

And here's the file:

badsub.zip

I hope you can fix this one. Thank you for the awesome library!

weizhenye commented 3 years ago

Fixed in v0.1.2