Skip to content

UI crashes if a UI camera is removed #4856

@robtfm

Description

@robtfm

Bevy version

main

Operating system & version

Windows 10

What you did

Run the text example and close the window.

What you expected to happen

Clean exit

What actually happened

thread 'main' panicked at 'view entity should exist: QueryDoesNotMatch(0v0)', crates\bevy_ui\src\render\render_pass.rs:72:14

Additional information

I think this occurs any time a CameraUI entity is despawned, but not if one is never spawned. I didn't look deeply into it, but would suggest we could just warn instead of expecting if the query doesn't resolve. Maybe "camera driven rendering" will fix this already.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-UIGraphical user interfaces, styles, layouts, and widgetsC-BugAn unexpected or incorrect behaviorP-CrashA sudden unexpected crash

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions