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
- After converting a Built-in project to URP render texture related errors are spammed that can lead to Game view being rendered on top of Scene view
- UI Builder slider value lags and stutters when sliding/modifying certain property values
- "Reset UI Builder Layout" functionality inconsistently changes Canva Size when "Match Game View" is enabled/disabled
- Texture Import Warnings are obscured by other Terrain Layer options in the Inspector
- Burst Inspector middle divider is jittering when resized with the Burst Inspector window docked
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)