tarkah / tickrs

Realtime ticker data in your terminal 📈
MIT License
1.17k stars 58 forks source link

Crashes when window resizes to smallest possible size #40

Closed sigaloid closed 3 years ago

sigaloid commented 3 years ago

Backtrace omitted. Run with RUST_BACKTRACE=1 to display it. Run with RUST_BACKTRACE=full to include source snippets.

The application panicked (crashed). index out of bounds: the len is 62 but the index is 109
in /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.9.5/src/buffer.rs, line 213

Backtrace omitted. Run with RUST_BACKTRACE=1 to display it. Run with RUST_BACKTRACE=full to include source snippets.

The application panicked (crashed). called Result::unwrap() on an Err value: "PoisonError { inner: .. }"
in src/main.rs, line 139 thread: main

Easy to replicate on my KDE neon, run ./tickrs, resize window to the smallest size possible. Maybe a check for unwrap as it doesn't seem to work if the console window is small. (probably 0x0 since only the edges are visible)

And I do mean smallest possible size: image

tarkah commented 3 years ago

Thanks for the bug report! I'll try to add a fix for this today.