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

An error that I accidentally found in the last topiс - NullReferenceException: Object reference not set to an instance of an object FigmaImporter.Editor.FigmaNodeGenerator.AddFills #31

Open
VladislavMm opened this issue May 13, 2023 · 2 comments

Comments

@VladislavMm
Copy link

VladislavMm commented May 13, 2023

NullReferenceException: Object reference not set to an instance of an object
FigmaImporter.Editor.FigmaNodeGenerator.AddFills (FigmaImporter.Editor.Node node, UnityEngine.GameObject nodeGo) (at Assets/Plugins/FI/Editor/FigmaNodeGenerator.cs:147)
image
They don't catch me like that because of this -
image
The project is very large and complex, before that they still get this warning-
Serialization depth limit 10 exceeded at 'FigmaImporter.Editor::Node.children'. There may be an object composition cycle in one or more of your serialized classes.

Serialization hierarchy:
11: FigmaImporter.Editor::Node.children
10: FigmaImporter.Editor::Node.children
9: FigmaImporter.Editor::Node.children
8: FigmaImporter.Editor::Node.children
7: FigmaImporter.Editor::Node.children
6: FigmaImporter.Editor::Node.children
5: FigmaImporter.Editor::Node.children
4: FigmaImporter.Editor::Node.children
3: FigmaImporter.Editor::Node.children
2: FigmaImporter.Editor::Node.children
1: FigmaImporter.Editor::Node.children
0: FigmaImporter.Editor::Node.children

This is an error message related to object serialization in Unity. The error occurs when the serialization depth limit of 10 levels is reached, and objects continue to refer to each other in a loop. This can happen if one object references another, and the second refers back to the first, creating an infinite loop. To solve this error, it is necessary to review the structure of objects and make sure that there are no cyclic references.

You can also try using another serialization method, for example, JSON or XML, instead of standard serialization in Unity. This can help avoid problems with serialization depth and circular references.

I don't think that if (node.field != null) probably a good solution, although it works well, it's good for me, maybe it won't be suitable for other people)
wrote it here that it is possible to solve it well and in the future someone will not encounter it

@VladislavMm VladislavMm changed the title An error that I accidentally found in the last topic, I thought it was solved) An error that I accidentally found in the last topiс) May 13, 2023
@VladislavMm VladislavMm changed the title An error that I accidentally found in the last topiс) An error that I accidentally found in the last topiс - NullReferenceException: Object reference not set to an instance of an object FigmaImporter.Editor.FigmaNodeGenerator.AddFills May 13, 2023
@VladislavMm
Copy link
Author

As an option -
image
image

@ManakhovN
Copy link
Owner

@VladislavMm Looks like the problem is in tree view. I will think how to limit it. I will also check the solution that you proposed. But a bit later. Thank you for your help 👍

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

No branches or pull requests

2 participants