msg: fix null pointer deref.
This commit is contained in:
@@ -22,7 +22,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
enableQuiet bool
|
enableQuiet bool
|
||||||
enableVerbose bool
|
enableVerbose bool
|
||||||
debug *dbg.DebugPrinter
|
debug = dbg.New()
|
||||||
w io.Writer
|
w io.Writer
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -123,5 +123,7 @@ func Println(a ...any) {
|
|||||||
// SetWriter changes the output for messages.
|
// SetWriter changes the output for messages.
|
||||||
func SetWriter(dst io.Writer) {
|
func SetWriter(dst io.Writer) {
|
||||||
w = dst
|
w = dst
|
||||||
|
dbgEnabled := debug.Enabled
|
||||||
debug = dbg.To(lib.WithCloser(w))
|
debug = dbg.To(lib.WithCloser(w))
|
||||||
|
debug.Enabled = dbgEnabled
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user