Skip to content

Warn when CameraUI is despawned#4861

Closed
rileysu wants to merge 1 commit intobevyengine:mainfrom
rileysu:main
Closed

Warn when CameraUI is despawned#4861
rileysu wants to merge 1 commit intobevyengine:mainfrom
rileysu:main

Conversation

@rileysu
Copy link

@rileysu rileysu commented May 28, 2022

Objective

Fixes #4856

Solution

Warn when camera isn't present instead of using .expect()

@DJMcNab
Copy link
Member

DJMcNab commented May 28, 2022

It's not clear to me that we should warn here. The fix used in #4527 follows the example of

match self.query.get_manual(world, view_entity) {
Ok(query) => query,
Err(_) => return Ok(()), // No window
};

We definitely should use an early return instead of a huge match block here, even if we do decide we want to warn here (i.e. use this PR).

@rileysu
Copy link
Author

rileysu commented May 28, 2022

This seems to be handled in #4527

@rileysu rileysu closed this May 28, 2022
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.

UI crashes if a UI camera is removed

2 participants