rabite0 / hunter

The fastest file manager in the galaxy!
Do What The F*ck You Want To Public License
1.32k stars 64 forks source link

Hunter crashes after pressing 'a' followed by 'l' #74

Closed d4h0 closed 4 years ago

d4h0 commented 4 years ago

Hi,

so I was testing 'actions' and tried it on a file by pressing 'a', followed by pressing 'l' (lower "L") on the first item ("UniActions"). The result was that hunter crashed:

thread 'main' panicked at 'index out of bounds: the len is 4 but the index is 18446744073709551615', /rustc/ff15e9670843f8bd6b54ab1b042d2095b4c0aa6d/src/libcore/slice/mod.rs:2797:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

It seems "UniActions" is just a headline (I thought it was an action), but I think hunter shouldn't crash if someone presses 'l' on that headline.

This doesn't happen for other headlines, and I can execute the "synchtop!" action without any problems by pressing 'l'.

PS: Here is the output with RUST_BACKTRACE=full (which doesn't seem to provide any additional information):

$ RUST_BACKTRACE=full hunter
thread 'main' panicked at 'index out of bounds: the len is 4 but the index is 18446744073709551615', /rustc/ff15e9670843f8bd6b54ab1b042d2095b4c0aa6d/src/libcore/slice/mod.rs:2797:10
stack backtrace:
   0:     0x56057893000c - <unknown>
   1:     0x5605788722bc - <unknown>
   2:     0x56057892f806 - <unknown>
   3:     0x56057892f42e - <unknown>
   4:     0x56057892ecfa - <unknown>
   5:     0x560578800889 - <unknown>
   6:     0x56057892e8fd - <unknown>
   7:     0x56057892e6ae - <unknown>
   8:     0x5605788703bd - <unknown>
   9:     0x560578870254 - <unknown>
  10:     0x5605787df1b6 - <unknown>
  11:     0x560578792b1f - <unknown>
  12:     0x560578753ca1 - <unknown>
  13:     0x5605787a996b - <unknown>
  14:     0x5605788041cc - <unknown>
  15:     0x5605786d1f42 - <unknown>
  16:     0x560578808868 - <unknown>
  17:     0x7fab46f55153 - __libc_start_main
  18:     0x5605786b316e - <unknown>
  19:                0x0 - <unknown>
rabite0 commented 4 years ago

Yeah, that shouldn't happen. I will look into it. Thanks for reporting.

rabite0 commented 4 years ago

Fixed. "Running" a header now opens/closes the section instead.