- edited description
NullReferenceException in Odin Project Validator when Script is missing
Issue #711
open
Odin Validator throws a NullReferenceException when scanning assets that contain missing scripts:
: Object reference not set to an instance of an object Sirenix.OdinValidator.Editor.ValidationRunner.ValidateObjectRecursively (System.Object value, System.Collections.Generic.List`1[Sirenix.OdinInspector.Editor.Validation.ValidationResult]& results) (at Assets/3rdParty/Sirenix/Odin Validator/Editor/Scripts/Editors/ValidationRunner.cs:49) Sirenix.OdinValidator.Editor.ValidationRunner.ValidateUnityObjectRecursively (UnityEngine.Object value, System.Collections.Generic.List`1[Sirenix.OdinInspector.Editor.Validation.ValidationResult]& results) (at Assets/3rdParty/Sirenix/Odin Validator/Editor/Scripts/Editors/ValidationRunner.cs:98) Sirenix.OdinValidator.Editor.AssetValidationProfile+<Validate>d__6.MoveNext () (at Assets/3rdParty/Sirenix/Odin Validator/Editor/Scripts/Profiles/AssetValidationProfile.cs:121) Sirenix.OdinValidator.Editor.ValidationProfileAsset`1+<Validate>d__10[T].MoveNext () (at Assets/3rdParty/Sirenix/Odin Validator/Editor/Scripts/Profiles/ValidationProfileAsset.cs:67) Sirenix.OdinValidator.Editor.ValidationCollectionProfile+<Validate>d__2.MoveNext () (at Assets/3rdParty/Sirenix/Odin Validator/Editor/Scripts/Profiles/ValidationCollectionProfile.cs:30) Sirenix.OdinValidator.Editor.ValidationProfileAsset`1+<Validate>d__10[T].MoveNext () (at Assets/3rdParty/Sirenix/Odin Validator/Editor/Scripts/Profiles/ValidationProfileAsset.cs:67) Sirenix.OdinValidator.Editor.ValidationProfileEditorDrawer+<>c__DisplayClass13_0.<ScanProfile>b__0 () (at Assets/3rdParty/Sirenix/Odin Validator/Editor/Scripts/Editors/ValidationProfileEditorDrawer.cs:174) UnityEditor.EditorApplication.Internal_CallDelayFunctions () (at <9ddd600ae5964fe0b21a870e08c53748>:0)
Steps to reproduce:
- Create a new MonoBehaviour script.
- Create a new prefab.
- Attach the newly created script to the root object of the prefab.
- Delete the script asset.
- Scan the prefab with Project Validator.
I expect a Validation error instead of the exception in this case.
Odin Inspector and Project Validator 3.0.1.0, Windows 10, Unity 2020.1.8f1
Comments (3)
-
Account Deactivated reporter -
-
assigned issue to
-
assigned issue to
-
- changed status to open
- Log in to comment