Skip to content

Attempting to render empty linestrips causes a crash #9089

@Elabajaba

Description

@Elabajaba

Bevy version

Bevy 0.11

What you did

Have a system that unconditionally runs gizmos.linestrip_2d(path, Color::YELLOW);, where path is an iterator over a list of points that can be empty.

What went wrong

It crashes with

thread 'main' panicked at 'Buffer slices can not be empty', C:\Users\elabajaba\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.16.2\src\lib.rs:2362:39
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in exclusive system `bevy_render::renderer::render_system`!

Additional information

I tested it on both vulkan and dx12.

It used to work on bevy main. #8910 is when it started crashing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-GizmosVisual editor and debug gizmosC-BugAn unexpected or incorrect behaviorP-CrashA sudden unexpected crash

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions