avoid a possible null ref

This commit is contained in:
UbitUmarov
2024-04-11 02:42:05 +01:00
parent bbac092621
commit c981f3c448
2 changed files with 4 additions and 3 deletions

View File

@@ -240,9 +240,8 @@ namespace OpenSim.Region.Framework.Scenes
if(state != null)
{
OSDMap s = (OSDMap)state;
if (s.ContainsKey("ViewerUiIsGod"))
newstate = s["ViewerUiIsGod"].AsBoolean();
if (s.TryGetValue("ViewerUiIsGod", out OSD tmp))
newstate = tmp.AsBoolean();
m_lastLevelToViewer = m_viewergodlevel; // we are not changing viewer level by default
}
UpdateGodLevels(newstate);