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

gamepad_viewer example broken when a controller is connected #15832

Closed
NiseVoid opened this issue Oct 10, 2024 · 2 comments · Fixed by #15854
Closed

gamepad_viewer example broken when a controller is connected #15832

NiseVoid opened this issue Oct 10, 2024 · 2 comments · Fixed by #15854
Labels
A-Input Player input via keyboard, mouse, gamepad, and more C-Bug An unexpected or incorrect behavior C-Examples An addition or correction to our examples S-Needs-Investigation This issue requires detective work to figure out what's going wrong
Milestone

Comments

@NiseVoid
Copy link
Contributor

Bevy version

11d1ebe

Relevant system information

  • Running Linux, happens on both wayland and X11 (trough xwayland).

What you did

With a controller connected run:

cargo run --example gamepad_viewer

When no controller is connected it starts correctly. When multiple controllers are detected it also crashes.

What went wrong

The app immediately exited

Additional information

The console output:

2024-10-10T18:35:28.259319Z  INFO bevy_winit::system: Creating new window "App" (0v1#4294967296)
2024-10-10T18:35:28.270366Z  INFO bevy_input::gamepad: Gamepad 5v1#4294967301 connected.
thread 'Compute Task Pool (15)' panicked at ./crates/bevy_text/src/text_access.rs:278:43:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: rust_begin_unwind
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:665:5
   1: core::panicking::panic_fmt
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panicking.rs:74:14
   2: core::panicking::panic
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panicking.rs:148:5
   3: core::option::unwrap_failed
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/option.rs:2020:5
   4: core::option::Option<T>::unwrap
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/option.rs:970:21
   5: bevy_text::text_access::TextWriter<R>::text
             at ./crates/bevy_text/src/text_access.rs:278:9
   6: gamepad_viewer::update_connected
             at ./examples/tools/gamepad_viewer.rs:468:6
   7: core::ops::function::FnMut::call_mut
@NiseVoid NiseVoid added C-Bug An unexpected or incorrect behavior C-Examples An addition or correction to our examples labels Oct 10, 2024
@NiseVoid NiseVoid added this to the 0.15 milestone Oct 10, 2024
@alice-i-cecile alice-i-cecile added A-Input Player input via keyboard, mouse, gamepad, and more S-Needs-Investigation This issue requires detective work to figure out what's going wrong labels Oct 10, 2024
@alice-i-cecile
Copy link
Member

Figuring out when this happened would be nice, but I'm strongly guessing #12770 is responsible.

@rparrett
Copy link
Contributor

rparrett commented Oct 10, 2024

Pretty sure this is just a mistake migrating the example for the text rework, but I don't have a gamepad to test just this moment.

github-merge-queue bot pushed a commit that referenced this issue Oct 11, 2024
# Objective

Fixes #15832

## Solution

It seems that this was just a transliteration mistake during #15591.

Update the correct text span index.

## Testing

I tested on macos with:

`cargo run --example gamepad_viewer`
- without gamepad connected
- with gamepad connected
- disconnecting and reconnecting gamepad while running
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Input Player input via keyboard, mouse, gamepad, and more C-Bug An unexpected or incorrect behavior C-Examples An addition or correction to our examples S-Needs-Investigation This issue requires detective work to figure out what's going wrong
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants