diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 4e10a4ec11c7d9d33c10a5f182c5d2b37c73693c..5ecf8f836f30888d2c2fab4b251b40076dc578ed 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -2969,7 +2969,7 @@ int evsel__open_strerror(struct evsel *evsel, struct target *target, struct perf_env *evsel__env(struct evsel *evsel) { - if (evsel && evsel->evlist) + if (evsel && evsel->evlist && evsel->evlist->env) return evsel->evlist->env; return &perf_env; }