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
fsassets
Steven Zielinski 2015-05-01 17:07:19 -04:00
parent 625452b84b
commit c4a3c93097
1 changed files with 5 additions and 1 deletions

View File

@ -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++;
}