Skip to content

Conversation

Antoshidza
Copy link
Contributor

@Antoshidza Antoshidza commented May 20, 2025

Pull Request Template

Description

It seems there are cases when ProjectContainer is null due to some exception during container build stage. So quitting play mode cause call ProjectContainer.Dispose on null. ProjectContainer?.Dispose simply check for null before call method, which prevent such exceptions.

Fixes # (issue)

In some cases after exiting play mode we get NullRefernceException due to null ProjectContainer

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

After code change I've run unit tests and also Reflex.Sample scene. All goes fine.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes
  • I have checked my code and corrected any misspellings
  • I have checked that Reflex.GettingStarted still runs nicely (I believe it is now called Reflex.Sample)

Added to prevent null reference exceptions when ProjectContainer is null due to container build failure. Such check shouldn't affect performance in any way, because happens only once when project container is disposed meaning end of app run.
@gustavopsantos gustavopsantos merged commit 7cabcdb into gustavopsantos:main May 21, 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