github icon indicating copy to clipboard operation
github copied to clipboard

issue: fix nil pointer dereference on plumb error

Open jroimartin opened this issue 6 years ago • 2 comments

plumbserve() fails with a nil pointer dereference when it tries to print errors via w.Err(). This happens because w is a dummy window with a nil *acme.Win. This commit replaces w.Err() calls in plumbserve() with acme.Errf(). It also extracts the plumbserve() method out of *awin, given that the previous change removes this dependency.

This PR also documents "githubissue" plumb port requirement and how to create it under the section "Acme Editor Integration".

Fixes issue #5.

jroimartin avatar Jan 11 '20 21:01 jroimartin

The initial version of the PR was using log.Printf() to output plumb errors. I've updated it to use acme.Errf() instead.

jroimartin avatar Jan 12 '20 15:01 jroimartin

Got halfway implementing this same patch then found this one. Thanks @jroimartin :)

ollytom avatar Jul 05 '22 08:07 ollytom