Skip to content

Conversation

Acissathar
Copy link
Contributor

PR Details

Attempting to select multiple entities may crash GameStudio due to an ArgumentNullException during the IsPrimitiveType check, as type is sometimes null. Selecting the entities individually does not appear to cause the issue.

I can recreate this pretty consistently with a New Game template specifically when multi-selecting the materials, as the Tessellation node property has a value of null. I am otherwise unable to recreate it with any other object/asset/entity types.

Given its specifically (for me at least) this Tessellation node property, I'm not entirely sure if this is more of a band-aid that is hiding something that should be dived into (like why is Tessellation node property null at this point) or not.

Running that guard locally seems to solve the problem though, and it still shows the property grid as expected.

Related Issue

#2903

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have built and run the editor to try this change out.

@Acissathar
Copy link
Contributor Author

As a follow up, I was finally able to recreate it with other entity types, such as Skeletons and Models, so I don't think it's specific to just Tessellation which makes me feel a little better about the more blanket return false.

@Eideren
Copy link
Collaborator

Eideren commented Sep 30, 2025

Given that this method does not specify that it accepts null, it should be fixed at the callsite of the method instead, and handled appropriately there.
The log specifies that it throws at

else if (nodePresenter.Factory.IsPrimitiveType(nodePresenter.Value?.GetType()))

@Acissathar Acissathar changed the title fix: Add null check for IsPrimitiveType to prevent crash when selecting multiple entities in GameStudio fix: No longer check IsPrimitiveType when nodePresenter.value is null to prevent crash when selecting multiple entities in GameStudio Sep 30, 2025
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.

2 participants