Search Issue Tracker
Won't Fix
Votes
0
Found in
2023.2.0a19
Issue ID
UUM-39824
Regression
Yes
[Linux] NullReferenceException error is thrown when adding a Script Component on a GameObject
How to reproduce:
1. Create a new Unity project
2. In the Hierarchy window create a new GameObject (right-click> 3D Object > Cube)
3. Select Cube GameObject in the Hierarchy window
4. While Cube GameObject is selected in the Inspector window press Add Component
5. In opened sub-menu scroll down and press "New Script"
6. Press "Create and Add" a New Script
7. Observe the error in the Console window
Expected results: no errors are thrown in the Console window
Actual results: error is thrown in the Console window
Reproducible with: 2023.2.0a19
Not reproducible with: 2023.2.0a18
Reproduced on: Ubuntu 20.04
Not reproducible on: macOS ventura 13.4
Note: full error (error is clearable):
{code:java}
ullReferenceException: Object reference not set to an instance of an object
UnityEditor.EditorStyles.get_label () (at /home/bokken/build/output/unity/unity/Editor/Mono/GUI/EditorStyles.cs:18)
UnityEditor.Events.InterceptedEventsPreview+Styles..ctor () (at ./Library/PackageCache/com.unity.ugui@2.0.0/Editor/UGUI/UI/InterceptedEventsPreview.cs:25)
UnityEditor.Events.InterceptedEventsPreview..ctor () (at ./Library/PackageCache/com.unity.ugui@2.0.0/Editor/UGUI/UI/InterceptedEventsPreview.cs:55)
System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) (at <4930970ba45b4c08aa04afc5f0dc7577>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) (at <4930970ba45b4c08aa04afc5f0dc7577>:0)
System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic, System.Boolean wrapExceptions) (at <4930970ba45b4c08aa04afc5f0dc7577>:0)
System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean wrapExceptions, System.Boolean skipCheckThis, System.Boolean fillCache) (at <4930970ba45b4c08aa04afc5f0dc7577>:0)
System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Boolean wrapExceptions, System.Threading.StackCrawlMark& stackMark) (at <4930970ba45b4c08aa04afc5f0dc7577>:0)
System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic, System.Boolean wrapExceptions) (at <4930970ba45b4c08aa04afc5f0dc7577>:0)
System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) (at <4930970ba45b4c08aa04afc5f0dc7577>:0)
System.Activator.CreateInstance (System.Type type) (at <4930970ba45b4c08aa04afc5f0dc7577>:0)
UnityEditor.PropertyEditor.GetPreviewsForType (UnityEditor.Editor editor) (at /home/bokken/build/output/unity/unity/Editor/Mono/Inspector/PropertyEditor.cs:975)
UnityEditor.PropertyEditor.CreatePreviewables () (at /home/bokken/build/output/unity/unity/Editor/Mono/Inspector/PropertyEditor.cs:930)
UnityEditor.PropertyEditor.RebuildContentsContainers () (at /home/bokken/build/output/unity/unity/Editor/Mono/Inspector/PropertyEditor.cs:1120)
UnityEditor.InspectorWindow.RedrawFromNative () (at /home/bokken/build/output/unity/unity/Editor/Mono/Inspector/InspectorWindow.cs:202)
{code}
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
- Inspector Ping does not fully encapsulate an element with an icon in the Project window
- “Property offset falls outside of range for type in GetPropertyData” errors are thrown when using MaterialPropertyBlock.CopySHCoefficientArraysFrom
- Texture 2D reference links to missing documentation
- [Search] Help (?) does not work as a Search Filter
- Quest apps lose head and controller tracking
Resolution Note:
Tested on 2023.2.0b2, the issue is no longer reproducible on Ubuntu 20.04. Closing ticket as not reproducible.