diff --git a/godoc/static/playground.js b/godoc/static/playground.js index aad459fa..1b7be65a 100644 --- a/godoc/static/playground.js +++ b/godoc/static/playground.js @@ -109,7 +109,10 @@ function HTTPTransport(enableVet) { dataType: "json", success: function(dataVet) { if (dataVet.Errors) { - // inject errors from the vet as the first event in the output + if (!data.Events) { + data.Events = []; + } + // inject errors from the vet as the first events in the output data.Events.unshift({Message: 'Go vet exited.\n\n', Kind: 'system', Delay: 0}); data.Events.unshift({Message: dataVet.Errors, Kind: 'stderr', Delay: 0}); } diff --git a/godoc/static/static.go b/godoc/static/static.go index 05117621..20edbe6c 100644 --- a/godoc/static/static.go +++ b/godoc/static/static.go @@ -2398,7 +2398,10 @@ function HTTPTransport(enableVet) { dataType: "json", success: function(dataVet) { if (dataVet.Errors) { - // inject errors from the vet as the first event in the output + if (!data.Events) { + data.Events = []; + } + // inject errors from the vet as the first events in the output data.Events.unshift({Message: 'Go vet exited.\n\n', Kind: 'system', Delay: 0}); data.Events.unshift({Message: dataVet.Errors, Kind: 'stderr', Delay: 0}); }