EditText UI element IsSelectionActive throws object reference error
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 49
Description
Release Type: Official Release
Version: 4.2.0.2282
Platform(s): Windows
Describe the bug
When enabling and focusing a EditText UI element using IsSelectionActive = true, the error Object reference not set to an instance of an object is thrown. However, the EditText element seems to be responsive and accepts input anyway.
To Reproduce
Repro project: https://github.com/BlackCurtainStudio/Stride-EditTextSample
Expected behavior
No errors should occur.
Screenshots
Log and callstacks
[EditTextSample.UiScript]: Error: Object reference not set to an instance of an object. [EditTextSample.UiScript]: Error: at Stride.Core.ServiceRegistryExtensions.GetSafeServiceAs[T](IServiceRegistry registry) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core\ServiceRegistryExtensions.cs:line 22 at Stride.UI.Controls.EditText.ActivateEditTextImpl() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.UI\Controls\EditText.Direct.cs:line 125 at Stride.UI.Controls.EditText.set_IsSelectionActive(Boolean value) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.UI\Controls\EditText.cs:line 160
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the linked Stride-EditTextSample on Windows, then inspect Stride.UI.Controls.EditText.Direct.cs at ActivateEditTextImpl and EditText.cs at the IsSelectionActive setter. Trace the service lookup shown in the call stack and verify that enabling selection no longer logs an object-reference error while the EditText remains usable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100