-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiler crashes when diverting to choice or gather labels with parameters #208
Comments
Hi! Sounds like a pretty serious one. Could you please log this in the Ink
repo? This codebase wraps that one for Unity.
…On Wed, Dec 4, 2024 at 05:47 benabutler ***@***.***> wrote:
If an ink file attempts to pass an argument while diverting to a choice or
gather label, the compiler will crash with this stack:
Ink Compiler threw exception
Error: Object reference not set to an instance of an object
---- Trace ----
at Ink.Parsed.Divert.GenerateRuntimeObject () [0x000cb] in Assets\Ink\InkLibs\InkCompiler\ParsedHierarchy\Divert.cs:90
at Ink.Parsed.Object.get_runtimeObject () [0x00012] in Assets\Ink\InkLibs\InkCompiler\ParsedHierarchy\Object.cs:55
at Ink.Parsed.Weave.GenerateRuntimeObject () [0x0009b] in Assets\Ink\InkLibs\InkCompiler\ParsedHierarchy\Weave.cs:198
at Ink.Parsed.Object.get_runtimeObject () [0x00012] in Assets\Ink\InkLibs\InkCompiler\ParsedHierarchy\Object.cs:55
at Ink.Parsed.FlowBase.GenerateRuntimeObject () [0x0019f] in Assets\Ink\InkLibs\InkCompiler\ParsedHierarchy\FlowBase.cs:247
at Ink.Parsed.Object.get_runtimeObject () [0x00012] in Assets\Ink\InkLibs\InkCompiler\ParsedHierarchy\Object.cs:55
at Ink.Parsed.FlowBase.GenerateRuntimeObject () [0x000eb] in Assets\Ink\InkLibs\InkCompiler\ParsedHierarchy\FlowBase.cs:217
at Ink.Parsed.Object.get_runtimeObject () [0x00012] in Assets\Ink\InkLibs\InkCompiler\ParsedHierarchy\Object.cs:55
at Ink.Parsed.Story.ExportRuntime (Ink.ErrorHandler errorHandler) [0x0013b] in Assets\Ink\InkLibs\InkCompiler\ParsedHierarchy\Story.cs:155
at Ink.Compiler.Compile () [0x00085] in Assets\Ink\InkLibs\InkCompiler\Compiler.cs:53
at Ink.UnityIntegration.InkCompiler.CompileInkThreaded (System.Object itemObj) [0x00085] in Assets\Ink\Editor\Core\Compiler\InkCompiler.cs:576
--------
It looks to me like the Divert.GenerateRuntimeObject assumes targetContent
will be a FlowBase if the user is providing arguments, but gathers and
choices are just regular Ink.Parsed.Object objects. I don't think passing
arguments to a gather point is valid Ink syntax - I only hit the crash
because I mistyped something - but the compiler should probably provide a
nice error message like it does for diverting with parameters to knots that
don't take parameters.
Here's a repro demonstrating the behavior:
InkCompilerCrashRepro.txt
<https://github.com/user-attachments/files/18003077/InkCompilerCrashRepro.txt>
I found this issue on v1.2.0 while using the ink-unity-integration plugin
v1.2.1, but also reproduced it on a standalone build of inky v1.1.0.
—
Reply to this email directly, view it on GitHub
<#208>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJR3UB66TMDB6CVPAYHISD2D2JOJAVCNFSM6AAAAABS7JRFE2VHI2DSMVQWIX3LMV43ASLTON2WKOZSG4YTMNRSGEYTSMI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Sure, new issue opened here: inkle/ink#921 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If an ink file attempts to pass an argument while diverting to a choice or gather label, the compiler will crash with this stack:
It looks to me like the Divert.GenerateRuntimeObject assumes targetContent will be a FlowBase if the user is providing arguments, but gathers and choices are just regular Ink.Parsed.Object objects. I don't think passing arguments to a gather point is valid Ink syntax - I only hit the crash because I mistyped something - but the compiler should probably provide a nice error message like it does for diverting with parameters to knots that don't take parameters.
Here's a repro demonstrating the behavior:
InkCompilerCrashRepro.txt
I found this issue on v1.2.0 while using the ink-unity-integration plugin v1.2.1, but also reproduced it on a standalone build of inky v1.1.0.
The text was updated successfully, but these errors were encountered: