Very easy to crash app with bad formula
withakay opened this issue · comments
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.
@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.
@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?
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.