Exception during search when including a '<' for a generic type if there isn't a match in current results list. #22

Closed
opened 2024-07-19 08:25:31 -05:00 by XDelta · 0 comments
XDelta commented 2024-07-19 08:25:31 -05:00 (Migrated from github.com)

During a search, if you type "<" when the previous search terms don't return any types that accepts generic T, the editing field stops being type-able. This becomes more noticeable if you have a low search result setting.

A simple reproduction case would be to search for DelayValue<int> with d < which will make the search field no longer type-able.

Ideally this exception is caught and allow the user to continue typing.

Doing d < would fail as the list contains no matches that accept a generic T
ee1cb27c84
f9dabbb63c

Doing de < would work (with the result count changed to 20) however as the list includes ValueDec<T> but with the default of 10 results, this would also break as the mentioned match is further down the list.

Here is the error that is logged.

6:03:08 AM.100 (144 FPS)	Exception in RunningCoroutine: FrooxEngine.TextEditor+<EditCoroutine>d__78
System.NullReferenceException: Object reference not set to an instance of an object
  at CherryPick.CherryPicker.EditChanged (FrooxEngine.TextEditor editor) [0x00197] in <bafd33091bdd4ca183731e129431e5bd>:0 
  at FrooxEngine.TextEditor+<EditCoroutine>d__78.MoveNext () [0x00559] in <141eb96ad34a4aa08171b7296004ee34>:0 
  at FrooxEngine.CoroutineManager.RunStep (FrooxEngine.CoroutineHandle coroutine) [0x0001d] in <141eb96ad34a4aa08171b7296004ee34>:0 

  at System.Environment.get_StackTrace () [0x00000] in <9577ac7a62ef43179789031239ba8798>:0 
  at Elements.Core.UniLog.Error (System.String message, System.Boolean stackTrace) [0x00000] in <d447a6cc5f4743dfa460802f0654914d>:0 
  at FrooxEngine.DebugManager.Error (System.Object obj, System.Boolean stackTrace) [0x00000] in <141eb96ad34a4aa08171b7296004ee34>:0 
  at FrooxEngine.CoroutineManager.RunStep (FrooxEngine.CoroutineHandle coroutine) [0x00000] in <141eb96ad34a4aa08171b7296004ee34>:0 
  at FrooxEngine.CoroutineManager.ExecuteWorldQueue (System.Double deltaTime) [0x00000] in <141eb96ad34a4aa08171b7296004ee34>:0 
  at MonoMod.Utils.DynamicMethodDefinition.FrooxEngine.World.RefreshStep_Patch1 (FrooxEngine.World ) [0x00000] in <abec11463bc04855a5322a0a868aeb22>:0 
  at FrooxEngine.World.Refresh () [0x00000] in <141eb96ad34a4aa08171b7296004ee34>:0 
  at FrooxEngine.WorldManager.UpdateStep () [0x00000] in <141eb96ad34a4aa08171b7296004ee34>:0 
  at FrooxEngine.WorldManager.RunUpdateLoop () [0x00000] in <141eb96ad34a4aa08171b7296004ee34>:0 
  at FrooxEngine.Engine.UpdateStep () [0x00000] in <141eb96ad34a4aa08171b7296004ee34>:0 
  at FrooxEngine.Engine.RunUpdateLoop () [0x00000] in <141eb96ad34a4aa08171b7296004ee34>:0 
  at UnityFrooxEngineRunner.FrooxEngineRunner.UpdateFrooxEngine () [0x00000] in <924f3bf77def4975a5d6d5f09bcf3fd1>:0 
  at UnityFrooxEngineRunner.FrooxEngineRunner.Update () [0x00000] in <924f3bf77def4975a5d6d5f09bcf3fd1>:0 
During a search, if you type "<" when the previous search terms don't return any types that accepts generic T, the editing field stops being type-able. This becomes more noticeable if you have a low search result setting. A simple reproduction case would be to search for `DelayValue<int>` with `d <` which will make the search field no longer type-able. Ideally this exception is caught and allow the user to continue typing. Doing `d <` would fail as the list contains no matches that accept a generic T ![ee1cb27c84](https://github.com/user-attachments/assets/64a3e5ba-d070-45c4-886e-a979a91cfa40) ![f9dabbb63c](https://github.com/user-attachments/assets/e36bfb5b-07ee-4486-8d2a-97af59c86f8c) Doing `de <` would work (with the result count changed to 20) however as the list includes `ValueDec<T>` but with the default of 10 results, this would also break as the mentioned match is further down the list. Here is the error that is logged. ``` 6:03:08 AM.100 (144 FPS) Exception in RunningCoroutine: FrooxEngine.TextEditor+<EditCoroutine>d__78 System.NullReferenceException: Object reference not set to an instance of an object at CherryPick.CherryPicker.EditChanged (FrooxEngine.TextEditor editor) [0x00197] in <bafd33091bdd4ca183731e129431e5bd>:0 at FrooxEngine.TextEditor+<EditCoroutine>d__78.MoveNext () [0x00559] in <141eb96ad34a4aa08171b7296004ee34>:0 at FrooxEngine.CoroutineManager.RunStep (FrooxEngine.CoroutineHandle coroutine) [0x0001d] in <141eb96ad34a4aa08171b7296004ee34>:0 at System.Environment.get_StackTrace () [0x00000] in <9577ac7a62ef43179789031239ba8798>:0 at Elements.Core.UniLog.Error (System.String message, System.Boolean stackTrace) [0x00000] in <d447a6cc5f4743dfa460802f0654914d>:0 at FrooxEngine.DebugManager.Error (System.Object obj, System.Boolean stackTrace) [0x00000] in <141eb96ad34a4aa08171b7296004ee34>:0 at FrooxEngine.CoroutineManager.RunStep (FrooxEngine.CoroutineHandle coroutine) [0x00000] in <141eb96ad34a4aa08171b7296004ee34>:0 at FrooxEngine.CoroutineManager.ExecuteWorldQueue (System.Double deltaTime) [0x00000] in <141eb96ad34a4aa08171b7296004ee34>:0 at MonoMod.Utils.DynamicMethodDefinition.FrooxEngine.World.RefreshStep_Patch1 (FrooxEngine.World ) [0x00000] in <abec11463bc04855a5322a0a868aeb22>:0 at FrooxEngine.World.Refresh () [0x00000] in <141eb96ad34a4aa08171b7296004ee34>:0 at FrooxEngine.WorldManager.UpdateStep () [0x00000] in <141eb96ad34a4aa08171b7296004ee34>:0 at FrooxEngine.WorldManager.RunUpdateLoop () [0x00000] in <141eb96ad34a4aa08171b7296004ee34>:0 at FrooxEngine.Engine.UpdateStep () [0x00000] in <141eb96ad34a4aa08171b7296004ee34>:0 at FrooxEngine.Engine.RunUpdateLoop () [0x00000] in <141eb96ad34a4aa08171b7296004ee34>:0 at UnityFrooxEngineRunner.FrooxEngineRunner.UpdateFrooxEngine () [0x00000] in <924f3bf77def4975a5d6d5f09bcf3fd1>:0 at UnityFrooxEngineRunner.FrooxEngineRunner.Update () [0x00000] in <924f3bf77def4975a5d6d5f09bcf3fd1>:0 ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: cyro/CherryPick#22
No description provided.