jakobhellermann / bevy_editor_pls

In-App editor tools for bevy applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

crash unwrapping the window optional in `toggle_cursor`

prime31 opened this issue · comments

Running on latest macOS with bevy 0.9.0 and bevy_editor_pls 0.2.0. Full stack trace is below.

2023-02-20T01:51:17.913022Z  INFO bevy_editor_pls_default_windows::cameras: Spawning editor cameras
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /Users/ddd/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_editor_pls_default_windows-0.2.0/src/cameras/camera_3d_free.rs:130:18
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: core::option::Option<T>::unwrap
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/option.rs:778:21
   4: bevy_editor_pls_default_windows::cameras::camera_3d_free::toggle_cursor
             at /Users/ddd/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_editor_pls_default_windows-0.2.0/src/cameras/camera_3d_free.rs:130:18
   5: core::ops::function::FnMut::call_mut
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/ops/function.rs:337:5
   6: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/ops/function.rs:617:13
   7: <Func as bevy_ecs::system::function_system::SystemParamFunction<(),Out,(F0,F1,F2),()>>::run::call_inner
             at /Users/ddd/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.9.1/src/system/function_system.rs:579:21
   8: <Func as bevy_ecs::system::function_system::SystemParamFunction<(),Out,(F0,F1,F2),()>>::run
             at /Users/ddd/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.9.1/src/system/function_system.rs:582:17
   9: <bevy_ecs::system::function_system::FunctionSystem<In,Out,Param,Marker,F> as bevy_ecs::system::system::System>::run_unsafe
             at /Users/ddd/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.9.1/src/system/function_system.rs:409:19
  10: bevy_ecs::schedule::executor_parallel::ParallelExecutor::prepare_systems::{{closure}}
             at /Users/ddd/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.9.1/src/schedule/executor_parallel.rs:218:26
  11: bevy_ecs::schedule::executor_parallel::ParallelExecutor::prepare_systems::{{closure}}
             at /Users/ddd/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.9.1/src/schedule/executor_parallel.rs:223:21
  12: async_executor::Executor::spawn::{{closure}}
             at /Users/ddd/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.5.0/src/lib.rs:139:19

fixed by removing the toggle_cursor function. That functionality was too opinionated anyways.