You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
A nil pointer dereference occurs when resizing a color picker dialog.
This only seems to only happen without setting an initial color with colorPicker.SetColor(c).
The real nil pointer occurs in popup.go.
It can be worked around with calling colorPicker.Refresh() before resizing.
How to reproduce
Create a color picker dialog (cp).
Do not set the initial color with cp.SetColor().
Call cp.Resize()
Call cp.Show()
Do the steps 1. to 4. again but with the second step modified to:
2. Do set set the initial color with cp.SetColor().
Linux 6.1.0-26-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.112-1 (2024-09-30) x86_64 GNU/Linux
Additional Information
The fix is rather simple.
Just call p.updateUI() in an own Resize method for the color picker before calling the base dialogs Resize method.
That will fill p.win and so prevent win from being nil.
I would be happy to provide a pull request.
The text was updated successfully, but these errors were encountered:
Checklist
Describe the bug
A nil pointer dereference occurs when resizing a color picker dialog.
This only seems to only happen without setting an initial color with
colorPicker.SetColor(c)
.The real nil pointer occurs in
popup.go
.It can be worked around with calling
colorPicker.Refresh()
before resizing.How to reproduce
cp
).cp.SetColor()
.cp.Resize()
cp.Show()
Do the steps 1. to 4. again but with the second step modified to:
2. Do set set the initial color with
cp.SetColor()
.The third step (Resize) will crash the app.
Screenshots
No response
Example code
Fyne version
2.5.2
Go compiler version
1.23.1
Operating system and version
Linux 6.1.0-26-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.112-1 (2024-09-30) x86_64 GNU/Linux
Additional Information
The fix is rather simple.
Just call
p.updateUI()
in an ownResize
method for the color picker before calling the base dialogsResize
method.That will fill
p.win
and so preventwin
from beingnil
.I would be happy to provide a pull request.
The text was updated successfully, but these errors were encountered: