Skip to content

Commit bada702

Browse files
authored
Handle nil output when writing progress message (#735)
Previously, the command `src lsif upload -no-progress` failed with a nil panic when using LSIF Typed. I was tempted to refactor the code so that `output` cannot be nil but decided not to in order to keep the diff small and focused on fixing the panic.
1 parent a12e88e commit bada702

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

cmd/src/lsif_upload_flags.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ func handleLSIFTyped(out *output.Output) error {
184184
// Reads the LSIF Typed encoded input file and writes the corresponding LSIF
185185
// Graph encoded output file.
186186
func convertLSIFTypedToLSIFGraph(out *output.Output, inputFile, outputFile string) error {
187-
out.Writef("%s Converting %s into %s", output.EmojiInfo, inputFile, outputFile)
187+
if out != nil {
188+
out.Writef("%s Converting %s into %s", output.EmojiInfo, inputFile, outputFile)
189+
}
188190
tmp, err := os.Create(outputFile)
189191
if err != nil {
190192
return err

0 commit comments

Comments
 (0)