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
[Inspector] Prevent crashing when a mesh's name is of the wrong type. #13893
Conversation
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
...s/dev/inspector/src/components/actionTabs/tabs/propertyGrids/parentPropertyGridComponent.tsx
Outdated
Show resolved
Hide resolved
Snapshot stored with reference name: Test environment: To test a playground add it to the URL, for example: https://babylonsnapshots.z22.web.core.windows.net/refs/pull/13893/merge/index.html#WGZLGJ#4600 Links to test babylon tools with this snapshot: https://playground.babylonjs.com/?snapshot=refs/pull/13893/merge To test the snapshot in the playground with a playground ID add it after the snapshot query string: https://playground.babylonjs.com/?snapshot=refs/pull/13893/merge#BCU1XR#0 |
…Grids/parentPropertyGridComponent.tsx Co-authored-by: Raanan Weber <raananw+github@gmail.com>
...s/dev/inspector/src/components/actionTabs/tabs/propertyGrids/parentPropertyGridComponent.tsx
Outdated
Show resolved
Hide resolved
...s/dev/inspector/src/components/actionTabs/tabs/propertyGrids/parentPropertyGridComponent.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure we should do this. This is adding extra code and why doing it here and not for all the other APIs we have ?
I guess the OP of the forum thread should use typescript to not use the API incorrectly ?
There might as well be smthg I did not get.
This is not the first time this problem has been reported to us and it's not always easy to find that it comes from a bad type in the mesh names, so dealing with the problem on our side would be nice, but as you say, why do it only for this one and not for everything else that could go wrong... It's a bug on the user side, after all, not in Babylon.js. So, after a second though, I would also vote not to do it. |
I don't see a warning in the scene as something critical, but I do think the solution for the inspector is important. This happens from time to time. We can stay defensive, at least in our tools. This is obviously not "our issue", but warning the user they did something wrong is not a bad thing :-) If you feel it's not the right place, maybe remove the scene changes. The playground changes should stay, as this breaks the inspector. |
Love the solution of doing the inspector only :-) |
This reverts commit b89ed96.
A user can mistakenly set a mesh's name with the wrong type (not string), like this example: https://playground.babylonjs.com/#XT7L5S, where trying to open the Inspector makes it crash. This PR just adds some extra type checking to avoid it crashing, and also adds a quick check to warn the user when adding to a scene.