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

GetEntites throws a NullReferenceException if the world doesn't contain any entities that match the query #11

Closed
MindSwipe opened this issue Nov 20, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@MindSwipe
Copy link
Contributor

Repro/ UnitTest for it:

[Test]
public void GetEntitesTest()
{
	world = World.Create();

	var archTypes = new Type[] { typeof(Transform) };
	var query = new QueryDescription { All = archTypes };

	var entity = world.Create(archTypes);

	var entites = new List<Entity>();
	world.GetEntities(query, entites);

	Assert.That(entites.Count, Is.EqualTo(1));

	entites.Clear();
	world.Destroy(entity);
	world.GetEntities(query, entites);

	Assert.That(entites.Count, Is.EqualTo(0));
}
@genaray
Copy link
Owner

genaray commented Nov 20, 2022

Hmmm... Thanks, thats odd, gonna look at it :)

@genaray genaray added the bug Something isn't working label Nov 20, 2022
@genaray
Copy link
Owner

genaray commented Nov 20, 2022

Latest nuget package featuring this fix : https://www.nuget.org/packages/Arch/1.0.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants