From f4e14aba6ddd0f2f567e761f4968293f2108be34 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 24 Feb 2024 16:36:15 +0000 Subject: [PATCH] fix webstats SStats defualt answer --- .../OptionalModules/UserStatistics/WebStatsModule.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs b/OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs index 9af5c3ed8c..3c92c6574a 100644 --- a/OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs +++ b/OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs @@ -261,11 +261,13 @@ namespace OpenSim.Region.UserStatistics // The request patch should be "/SStats/reportName" where 'reportName' // is one of the names added to the 'reports' hashmap. - regpath = regpath.Remove(0, 8); - if (regpath.Length == 0) regpath = "default.report"; - if (reports.ContainsKey(regpath)) + if (regpath.Length > 9) + regpath = regpath.Remove(0, 8); + else + regpath = "default.report"; + + if (reports.TryGetValue(regpath, out IStatsController rep)) { - IStatsController rep = reports[regpath]; Hashtable repParams = new Hashtable(); if (request.ContainsKey("json"))