csv: Fix a segfault when using non-hardware input.

This commit is contained in:
Uwe Hermann 2016-09-02 20:05:52 +02:00
parent 9e24c8bc65
commit cf1d5f1749
1 changed files with 1 additions and 1 deletions

View File

@ -236,7 +236,7 @@ static GString *gen_header(const struct sr_output *o,
sr_info("Set sample period to %" PRIu64 " %s", sr_info("Set sample period to %" PRIu64 " %s",
ctx->period, ctx->xlabel); ctx->period, ctx->xlabel);
} }
ctx->title = o->sdi->driver->longname; ctx->title = (o->sdi && o->sdi->driver) ? o->sdi->driver->longname : "unknown";
/* Some metadata */ /* Some metadata */
if (ctx->header && !ctx->did_header) { if (ctx->header && !ctx->did_header) {