TypesettingTools / Aegisub-Motion

Lua plugin for Aegisub auto4 that parses motion tracking data and applies it to selected subtitles.
Other
172 stars 23 forks source link

Exception with mal-formatted data #27

Closed FichteFoll closed 9 years ago

FichteFoll commented 9 years ago

I initially temp-saved the data into a text editor, which replaced all tabs with spaces (which I only found out to be a problem later). I replaced most of the wrong spaces with tabs again using regualr expressions, but one was missing: the first line in the Rotation section. Don't ask me how that could happen.

While I would normally suggest to accept spaces as well, I guess relying on correctly formatted data is reasonable and simplifies the parsing since all separators are tab characters. Either way, it would probabaly be better if the error was caught.

The Traceback:

Lua reported a runtime error:
    File "C:/Users\Fichte\AppData\Roaming\Aegisub\automation\autoload\Aegisub-Motion.moon", line 476
<anonymous function at lines 350-489>
    File "C:/Users\Fichte\AppData\Roaming\Aegisub\automation\include\a-mo\MotionHandler.moon", line 89
applyMotion
    File "C:/Users\Fichte\AppData\Roaming\Aegisub\automation\include\a-mo\MotionHandler.moon", line 167
method
    File "C:/Users\Fichte\AppData\Roaming\Aegisub\automation\include\a-mo\DataHandler.moon", line 107
calculateCurrentState
attempt to perform arithmetic on a nil value

The Data: http://dpaste.com/0WMR05K (github auto-replaces tabs with spaces in comments)

torque commented 9 years ago

Thanks for the report. Will fix soon.

FichteFoll commented 9 years ago

Small note that I found a few other missing tabs in other headers later that resulted in either the same or a similar traceback.