-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
C-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorS-Needs-TriageThis issue needs to be labelledThis issue needs to be labelled
Description
Bevy version
Relevant system information
Windows 11 + Vulkan
What you did
Close window with the close button when running following snippet
use bevy::app::{App, Startup, Update};
use bevy::DefaultPlugins;
use bevy::prelude::{Camera2dBundle, Commands, Query, Window};
fn setup(
mut commands: Commands,
) {
commands.spawn(Camera2dBundle::default());
}
fn check_window_status(
window_query: Query<&Window>,
) {
let window = window_query.get_single().unwrap();
println!("Title: {}", window.title);
}
fn main() {
let mut app = App::new();
app.add_plugins(DefaultPlugins)
.add_systems(Startup, setup)
.add_systems(Update, check_window_status);
app.run();
}What went wrong
check_window_status triggers panic
thread 'Compute Task Pool (2)' panicked at src\main.rs:14:44:
called `Result::unwrap()` on an `Err` value: NoEntities("bevy_ecs::query::state::QueryState<&bevy_window::window::Window>")
Additional information
Previous commit (b8832dc) won't trigger panic
Metadata
Metadata
Assignees
Labels
C-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorS-Needs-TriageThis issue needs to be labelledThis issue needs to be labelled