Odin Validator - 'Reference Required' throws exception when ScriptableObject reference is missing in inspector.

Issue #870 open
Lucas Van Hooste created an issue

1. What happened? An InvalidCastException is shown when ‘Reference Required by Default’ is turned on in the Odin Validator and a reference to a custom ScriptableObject is missing in the inspector.

2. How can we reproduce it? Create a script that derives from ScriptableObject. Create a script the derives from MonoBehaviour and add a public field to it. of the ScriptableObject type that you created. Attach the Monobehaviour to an object in a scene. Turn on ‘Reference Required by Default’ rule in the Validator and check ‘Include All by Default’ in the settings of the rule. When you run the validator an exception will be shown instead of the usual ‘missing reference’ message.

3. If screenshots would help explain or demonstrate your issue, please include these.

4. What version of Unity are you using? 2020.3.14, but also reproduced it in 2021.2.13.

5. What version of Odin are you using? (See "Tools > Odin Inspector > About") 3.1.0.19

6. Do you have Editor Only mode enabled? Yes, but also reproduced the bug with it disabled.

7. What operating system are you on? Windows 10.

Comments (2)

  1. Bjarke Elias

    This is also the first time I’m seeing multiline issues rendering a little bit of the second line. So there are two issues here to resolve.

  2. Log in to comment