Skip to content

Commit

Permalink
Avoid panic when benchmark.gfxtrace is not found (#2689)
Browse files Browse the repository at this point in the history
  • Loading branch information
hevrard authored Mar 25, 2019
1 parent be70617 commit 06e6639
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/gapit/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,11 @@ func (verb *benchmarkVerb) Run(ctx context.Context, flags flag.FlagSet) error {
defer func() {
stopGapitTrace()
stopGapisTrace()
if err := writeTrace(verb.DumpTrace, gapisTrace, gapitTrace); err != nil {
log.E(ctx, "Failed to write trace: %v", err)
// writeTrace may not be initialized yet
if writeTrace != nil {
if err := writeTrace(verb.DumpTrace, gapisTrace, gapitTrace); err != nil {
log.E(ctx, "Failed to write trace: %v", err)
}
}
}()
}
Expand Down

0 comments on commit 06e6639

Please sign in to comment.