Skip to content

binding.Untyped crashes when set to nil #4807

Closed
@williambrode

Description

Checklist

  • I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

When setting a binding.Untyped to nil, it crashes. I expect this case to work - since the type I'm using is a pointer and could be nil. The code seems to handle nil properly in several code paths, but not for .Set()

How to reproduce

Set binding.Untyped to something other than nil, then set it to nil.

Screenshots

No response

Example code

 a := binding.NewUntyped()
 a.Set(nil)  // this is fine since it's already set to nil
 b := 1
 a.Set(&b)
 a.Set(nil) // crashes

Fyne version

2.4.4

Go compiler version

1.19.3

Operating system and version

Windows 10

Additional Information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions