From c4a3c93097c9a1c1b93f5b86dfc0f17062e42c30 Mon Sep 17 00:00:00 2001 From: Steven Zielinski Date: Fri, 1 May 2015 17:07:19 -0400 Subject: Fixed a bug that would cause the sim extra stats reporter to fail in reporting stats. The bug was caused by the current process threads which can return null references. Test Plan: Tested on windows using opensim standalone and the json stats. Reviewers: rlouden, kboswell, clattin, martin, ssirigam Differential Revision: http://cr.irl.ucf.edu/D277 --- OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs index 432efdb..83d9e85 100755 --- a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs +++ b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs @@ -433,7 +433,11 @@ Asset service request failures: {3}" + Environment.NewLine, foreach (ProcessThread currentThread in Process.GetCurrentProcess().Threads) { - if (currentThread.ThreadState == ThreadState.Running) + // A known issue with the current process .threads method is + // that it can return null threads, thus don't count those as + // running threads and prevent the program function from failing + if (currentThread != null && + currentThread.ThreadState == ThreadState.Running) { numberThreadsRunning++; } -- cgit v1.1