From: Peter Bons Date: Thu, 26 Sep 2019 21:30:23 +0000 (+0200) Subject: Fix output of console writer of dotnet-counters when displayname is not set. (#505) X-Git-Tag: submit/tizen/20200402.013218~14^2^2~44 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0800fb2e9e25ba75b608645581a425db4bb4986c;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git Fix output of console writer of dotnet-counters when displayname is not set. (#505) --- diff --git a/src/Tools/dotnet-counters/ConsoleWriter.cs b/src/Tools/dotnet-counters/ConsoleWriter.cs index 0714529c3..5778480b2 100644 --- a/src/Tools/dotnet-counters/ConsoleWriter.cs +++ b/src/Tools/dotnet-counters/ConsoleWriter.cs @@ -104,7 +104,7 @@ namespace Microsoft.Diagnostics.Tools.Counters if (!provider.Counters.TryGetValue(name, out ObservedCounter counter)) { - string displayName = provider.KnownProvider?.TryGetDisplayName(name) ?? payload.GetDisplay() ?? name; + string displayName = provider.KnownProvider?.TryGetDisplayName(name) ?? (string.IsNullOrWhiteSpace(payload.GetDisplay()) ? name : payload.GetDisplay()); provider.Counters[name] = counter = new ObservedCounter(displayName); maxNameLength = Math.Max(maxNameLength, displayName.Length); redraw = true;