Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle the case where a MonoBehaviour is null #444

Merged
merged 1 commit into from Nov 9, 2022

Conversation

JesseTG
Copy link
Contributor

@JesseTG JesseTG commented Nov 8, 2022

The array or list returned by GameObject.GetComponents might have a null element if a MonoBehaviour's type couldn't be found (e.g. if it was stripped). See here for details.

- It might be null if its type couldn't be found
- Resolves `NullReferenceException`s in cases where a MonoBehaviour's type was stripped
@vercel
Copy link

vercel bot commented Nov 8, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
vcontainer ✅ Ready (Inspect) Visit Preview Nov 8, 2022 at 8:48PM (UTC)

@hadashiA
Copy link
Owner

hadashiA commented Nov 9, 2022

I think this is a hard-to-find bug, so I appreciate it very much. Thanks.

@hadashiA hadashiA merged commit 3e12fcd into hadashiA:master Nov 9, 2022
@JesseTG JesseTG deleted the jtg/survive-missing-components branch November 9, 2022 14:08
@JesseTG
Copy link
Contributor Author

JesseTG commented Nov 9, 2022

You're welcome, I'm happy to help. Keep up the good work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants