Search Issue Tracker

Fixed

Fixed in 2019.4.X, 2020.3.X

Votes

8

Found in

2019.4.37f1

2020.3.31f1

Issue ID

1411915

Regression

Yes

Editor crashes when adding a script component using drag and drop and the class name is different than the file name

Scripting

-

Reproduction steps:
1. Open the user's attached project
2. Select any GameObject in the Hierarchy
3. Drag "Move.cs" script from the Project window and drop it on "Add Component" in the Inspector

Reproducible with: 2019.4.37f1, 2020.3.31f1, 2020.3.32f1
Not reproducible with: 2019.4.36f1, 2020.3.30f1, 2021.2.17f1, 2022.1.0b13, 2022.2.0a8

Start of stack traces:
#0 0x00000159a30b6c in mono_class_get_image
#1 0x000001091b575d in scripting_class_get_assemblyname(ScriptingClassPtr)
#2 0x0000010913dad3 in FindScriptByClass(core::hash_map<MonoScriptKey, PPtr<MonoScript>, core::hash<MonoScriptKey>, std::__1::equal_to<MonoScriptKey> >&, vector_set<PPtr<MonoScript>, std::__1::less<PPtr<MonoScript> >, stl_allocator<PPtr<MonoScript>, (MemLabelIdentifier)84, 16> > const&, ScriptingClassPtr)
#3 0x00000109139955 in MonoScriptManager::FindRuntimeScript(ScriptingClassPtr)
#4 0x00000108af7da6 in CollectComponentsWithoutAdding(GameObject&, Unity::Type const*, ScriptingClassPtr, dynamic_array<AddComponentData, 0ul>&, dynamic_array<AddComponentData, 0ul>&, core::basic_string<char, core::StringStorageDefault<char> >*)
#5 0x00000108af8952 in WillAddComponentChangeTransform(GameObject&, Unity::Type const*, ScriptingClassPtr)

at <unknown> <0xffffffff>
at (wrapper managed-to-native) UnityEditorInternal.InternalEditorUtility.InspectorWindowDrag (UnityEngine.Object[],bool) [0x00008] in <9f01bdfe2db54f738bae09d12d90e1b8>:0
at (wrapper runtime-invoke) <Module>.runtime_invoke_DragAndDropVisualMode_object_byte (object,intptr,intptr,intptr) [0x00063] in <9f01bdfe2db54f738bae09d12d90e1b8>:0
at <unknown> <0xffffffff>
at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) [0x00016] in <695d1cc93cca45069c528c15c9fdd749>:0

at <unknown> <0xffffffff>
at (wrapper managed-to-native) UnityEditorInternal.InternalEditorUtility.HierarchyWindowDragByID (int,UnityEditorInternal.InternalEditorUtility/HierarchyDropMode,UnityEngine.Transform,bool) [0x0000a] in <9f01bdfe2db54f738bae09d12d90e1b8>:0
at (wrapper runtime-invoke) <Module>.runtime_invoke_DragAndDropVisualMode_int_int_object_byte (object,intptr,intptr,intptr) [0x0007b] in <9f01bdfe2db54f738bae09d12d90e1b8>:0
at <unknown> <0xffffffff>
at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) [0x00016] in <695d1cc93cca45069c528c15c9fdd749>:0

  1. Resolution Note (fix version 2020.3):

    Fixed in: 2020.3.33f1

  2. Resolution Note (fix version 2019.4):

    Fixed in 2019.4.38f1

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.