Search Issue Tracker
Fixed
Fixed in 2021.3.0f1, 2022.3.0f1
Votes
11
Found in
2021.3.31f1
2022.3.12f1
Issue ID
UUM-37282
Regression
Yes
[Android] TMP_InputField throws an exception upon Submit
see: https://unity.slack.com/archives/C06TQC5TK/p1685380002972049
Editing a textfield on Android and then submitting throws an exception.
Steps:
1. Create a scene with a Canvas
2. Add a TMPro Input field
3. Run the app on an Android device
4. Once the app is running on the device, focus the input field and enter some text
5. Submit
A quick investigation shows that eventData is null when TMP_InputField.OnSubmit is called.
Here is the stack
/Unity: NullReferenceException: Object reference not set to an instance of an object.
at TMPro.TMP_InputField.OnSubmit (UnityEngine.EventSystems.BaseEventData eventData) [0x0003f] in ./Library/PackageCache/com.unity.ugui@2.0.0/Runtime/TMP/TMP_InputField.cs:4438
at TMPro.TMP_InputField.LateUpdate () [0x002cb] in ./Library/PackageCache/com.unity.ugui@2.0.0/Runtime/TMP/TMP_InputField.cs:1747
Comments (3)
-
thiagolrosa
Dec 08, 2023 11:51
I have a small game and it has thousands crashes. A big game is probably having millions of these crashes and they are still "under consideration", this is ridiculous...
-
MaskedMouse
Nov 27, 2023 14:11
TMPro 3.2.0-pre.6 has this issue as well.
It's a little bit stupid that OnSubmit is calling the Use() method of the eventData without checking whether the eventData is null.
There are multiple places where OnSubmit is being called with null.
Simple fix is to null check.Does Unity not have possible null reference analysis on their code?
It would've been easily prevented. -
tuomas_wildspark
Aug 23, 2023 17:48
Happens on iOS as well.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- UI Toolkit throws warning and fails to clear references when fields are not typed as UnityEngine.Object
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
- AI Assistant breaks compilation of packages using System.Runtime.CompilerServices.Unsafe via auto-referencing
- Unity Hub checks the "Documentation" module by default on the 6.4 and 6.5 streams despite that it was unchecked with the previous installs
- Shortcut that toggles between Dopesheet and Curves Views in the Animation Window's Timeline is mislabed
Resolution Note (fix version 2022.3.0f1):
Fixed editing a textfield on mobile and then submitting throws an exception. Fixed in 3.2.0-pre.7
Resolution Note (fix version 2021.3.0f1):
Fixed editing a textfield on mobile and then submitting throws an exception (3.2.0-pre.7)