Change-Id: I72bac8a85db14494298059f8efddc5cbbf45f7ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/279214
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
 // FlushErrors sorts errors seen so far by line number, prints them to stdout,
 // and empties the errors array.
 func FlushErrors() {
-       Ctxt.Bso.Flush()
+       if Ctxt != nil && Ctxt.Bso != nil {
+               Ctxt.Bso.Flush()
+       }
        if len(errorMsgs) == 0 {
                return
        }