Skip to content

Commit

Permalink
ForNeVeR#60 added a style validator
Browse files Browse the repository at this point in the history
Fixed the crash caused when the style is incomplete.
  • Loading branch information
B3zaleel authored Aug 31, 2018
1 parent 19d5ac6 commit bebfe08
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/WpfMath/Parsers/TexFormulaParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,9 @@ private Atom GetSimpleFractionAtom(TexFormula formula,SourceSpan value,ref int p
TexFormula numeratorFormula = null;
TexFormula denominatorFormula = null;

if(fracparamsfound=false)
throw new TexParseException("The current fraction style is invalid");

if (Regex.IsMatch(sb.ToString(), @".+/.+"))
{
midLength = sb.ToString().Split('/')[0].Length;
Expand Down

0 comments on commit bebfe08

Please sign in to comment.