Sambigeara / fuzzynote

Terminal-based, hyper-fast, CRDT-backed, collaborative note-taking tool
GNU Affero General Public License v3.0
371 stars 8 forks source link

crash when parsing URL #94

Closed taviso closed 2 years ago

taviso commented 2 years ago

If you hit Ctrl-C with no URL, fzn crashes in term.(*Terminal).HandleEvent.

Reproduce:

  1. fzn --root /tmp
  2. Hit Ctrl-C
panic: runtime error: invalid memory address or nil pointer dereference
Sambigeara commented 2 years ago

Sorry, been a bit quiet on this project the last few months, but back to it now 👍

Will address this once another pretty hefty change is merged - thanks for raising.

Sambigeara commented 2 years ago

Hmm, I did just try and recreate and was unable to, though.

I know this was a while ago now (sorry again 🙈), but do you remember if this was consistently occurring? Fresh fzn instances or indeed my own instance aren't raising the same behaviour. Also - other potential factors, what version of fzn and what OS are/were you running on?

taviso commented 2 years ago

Yes, works every time here on Ubuntu focal.

The bug is that t.c.CurItem could be nil here:

https://github.com/Sambigeara/fuzzynote/blob/main/pkg/term/client.go#L383

Sambigeara commented 2 years ago

Ah, gotcha - I'd been trying to reproduce on items with no URL rather than the top search line. Thanks.

Sambigeara commented 2 years ago

Fixed in v0.24.1