Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Error calling InkChoice GetTags() via GDScript Interop #84

Closed
Bard09 opened this issue Feb 9, 2024 · 1 comment
Closed

Error calling InkChoice GetTags() via GDScript Interop #84

Bard09 opened this issue Feb 9, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Bard09
Copy link

Bard09 commented Feb 9, 2024

Describe the bug
Calling GetTags() on an InkChoice from GDScript (via Interop) results in the following error:

E 0:00:00:0718   Array.cs:1091 @ Godot.Collections.Array`1..ctor(System.Collections.Generic.IEnumerable`1[T]): System.ArgumentNullException: Value cannot be null. (Parameter 'collection')
  <C# Error>     System.ArgumentNullException
  <C# Source>    /root/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs:1091 @ Godot.Collections.Array`1..ctor(System.Collections.Generic.IEnumerable`1[T])
  <Stack Trace>  Array.cs:1091 @ Godot.Collections.Array`1..ctor(System.Collections.Generic.IEnumerable`1[T])
                 InkChoice.Interop.cs:38 @ Godot.Collections.Array`1[System.String] GodotInk.InkChoice.GetTags()
                 GodotInk.InkChoice_ScriptMethods.generated.cs:76 @ bool GodotInk.InkChoice.InvokeGodotClassMethod(Godot.NativeInterop.godot_string_name&, Godot.NativeInterop.NativeVariantPtrArgs, Godot.NativeInterop.godot_variant&)
                 CSharpInstanceBridge.cs:24 @ Godot.NativeInterop.godot_bool Godot.Bridge.CSharpInstanceBridge.Call(nint, Godot.NativeInterop.godot_string_name*, Godot.NativeInterop.godot_variant**, int, Godot.NativeInterop.godot_variant_call_error*, Godot.NativeInterop.godot_variant*)

To Reproduce
Run the following in GDScript:

const InkChoice: CSharpScript = preload("res://addons/GodotInk/Src/InkChoice.cs")
var story: InkStory = preload("res://InkStory.ink")

var available_choices: Array = story.GetCurrentChoices()
for each_choice: InkChoice in available_choices:
	var available_tags = each_choice.GetTags()

Environment

  • OS: Windows 11
  • Godot version: 4.2 mono
  • godot-ink version: 1.1.1
@Bard09 Bard09 added the bug Something isn't working label Feb 9, 2024
@paulloz
Copy link
Owner

paulloz commented Feb 11, 2024

Good catch, thanks for the report 🙏

paulloz added a commit that referenced this issue Feb 12, 2024
paulloz added a commit that referenced this issue Feb 12, 2024
paulloz added a commit that referenced this issue Feb 12, 2024
@paulloz paulloz added waiting for the next release This issue is resolved but waiting to be released and removed waiting for the next release This issue is resolved but waiting to be released labels Feb 12, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants