Skip to content

Commit 70a9c71

Browse files
author
Delta-Kronecker
committed
launcher: fix NullReferenceException in circuit monitor (TryGetValue leaves reason null)
1 parent 7f89c1d commit 70a9c71

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

scripts/start-tor.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,10 +1606,10 @@ private static void CircuitWatchLoop()
16061606
Console.WriteLine("circuit monitor: conflux legs:");
16071607
foreach (string[] leg in legList)
16081608
{
1609-
string reason = "";
1609+
string reason;
16101610
toRemoveReasons.TryGetValue(leg[1], out reason);
1611-
string mark = reason.Length > 0
1612-
? " <-- removing (" + reason + ")" : "";
1611+
string mark = string.IsNullOrEmpty(reason)
1612+
? "" : " <-- removing (" + reason + ")";
16131613
if (leg[4].Equals("LINKED", StringComparison.OrdinalIgnoreCase))
16141614
{
16151615
int rttUs;

0 commit comments

Comments
 (0)