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
- [Linux] TMP Font Asset pop-up Window opens on the secondary monitor when the Editor is placed in primary monitor
- Transition delay is ignored when opacity is listed before scale in transition-property of the Styles.uss file
- “NullReferenceException” error thrown in the Console when pressing kebab button in Pipeline Specific Settings for Default Profile in Project Settings window
- [Silicon] Crash on os_unfair_recursive_lock_lock_with_options when opening a project while the Razer Synapse app is open
- Build fails with a warning when running Unity Editor’s csc.dll manually using dotnet command
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)