carrierdown / mutateful

Add-on for Ableton Live that enables live coding functionality fully integrated into Live's session view.
GNU General Public License v3.0
406 stars 13 forks source link

Very easy to crash app with bad formula #20

Closed withakay closed 5 years ago

withakay commented 5 years ago

Inputting an incorrect formula crashes the app. For example [A1] =b1 slice /8 results in

Received 1 clips and formula: [<b1>0] slice /8 transpose -12
Unhandled exception. System.FormatException: Input string was not in a correct format.
carrierdown commented 5 years ago

@withakay This should be easy to fix, but would be great if you could post more formulas that cause crashes. I've tested this somewhat myself, but having designed the syntax I guess it's just difficult to think of all the various syntactical errors that might appear. It should be quite robust with regards to unknown tokens, but incorrect/partial tokens that it recognizes, such as /8 is apparently a different story.

withakay commented 5 years ago

@carrierdown if I find more I will post them here.

I have not really dug into the code so this is probably a naive but... Would a last line of defence not be to add a try/catch in ProcessChainedCommand and return a warning?

carrierdown commented 5 years ago

That's probably a good idea. I was under the false impression that the parser would handle the majority of what was thrown at it, but alas... try/catch is probably nice as a last resort here.