mrusme / reader

reader is for your command line what the “readability” view is for modern browsers: A lightweight tool offering better readability of web pages on the CLI.
https://xn--gckvb8fzb.com/reader-web-page-readability-on-the-cli/
GNU General Public License v3.0
258 stars 9 forks source link

panic: runtime error: invalid memory address or nil pointer dereference #9

Closed Dialga closed 2 years ago

Dialga commented 2 years ago

Segfault on first run.

$ reader https://example.com
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xc2a4a5]

goroutine 1 [running]:
github.com/mrusme/reader/cmd.MakeReadable(0xc0006ffd00?)
        /home/runner/work/reader/reader/cmd/root.go:61 +0x265
github.com/mrusme/reader/cmd.glob..func1(0x1534840?, {0xc0001c35f0?, 0x1?, 0x1?})
        /home/runner/work/reader/reader/cmd/root.go:214 +0x52
github.com/spf13/cobra.(*Command).execute(0x1534840, {0xc0000c4010, 0x1, 0x1})
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:876 +0x67b
github.com/spf13/cobra.(*Command).ExecuteC(0x1534840)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:990 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:918
github.com/mrusme/reader/cmd.Execute()
        /home/runner/work/reader/reader/cmd/root.go:267 +0xf9
main.main()
        /home/runner/work/reader/reader/reader.go:6 +0x17
mrusme commented 2 years ago

Fixed and tested locally, seems to work now. Releasing v0.3.0 now that will include the fix.