From 347eaaae3d79642caa12b774f07b735f15dde485 Mon Sep 17 00:00:00 2001 From: Joseph Humfrey Date: Thu, 8 Nov 2018 09:39:33 +0000 Subject: [PATCH] Fix for mal-formed logic lines crashing compiler --- compiler/InkParser/InkParser_Logic.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/InkParser/InkParser_Logic.cs b/compiler/InkParser/InkParser_Logic.cs index 64152826..e977fa52 100644 --- a/compiler/InkParser/InkParser_Logic.cs +++ b/compiler/InkParser/InkParser_Logic.cs @@ -29,6 +29,9 @@ protected Parsed.Object LogicLine() var result = Expect(afterTilda, "expression after '~'", recoveryRule: SkipToNextLine) as Parsed.Object; + // Prevent further errors, already reported expected expression and have skipped to next line. + if (result == null) return new ContentList(); + // Parse all expressions, but tell the writer off if they did something useless like: // ~ 5 + 4 // And even: