Permalink
Browse files

Do not add a null writer

  • Loading branch information...
ralarcon committed Oct 13, 2017
1 parent 874f7c6 commit 2917c0318d712de4cd5cc1364feea0db71d39cd6
Showing with 5 additions and 2 deletions.
  1. +5 −2 code/src/Core/Diagnostics/AppHealth.cs
@@ -50,9 +50,12 @@ private AppHealth()
public void AddWriter(IHealthWriter newWriter)
{
if (newWriter.AllowMultipleInstances() || !HealthWriters.Available.Where(w => w.GetType() == newWriter.GetType()).Any())
if (newWriter != null)
{
HealthWriters.Available.Add(newWriter);
if (newWriter.AllowMultipleInstances() || !HealthWriters.Available.Where(w => w.GetType() == newWriter.GetType()).Any())
{
HealthWriters.Available.Add(newWriter);
}
}
}

0 comments on commit 2917c03

Please sign in to comment.