1
0
Fork 0
4Creative-Changes/CurrentPatches/0001-add-some-null-checks.p...

38 lines
1.3 KiB
Diff
Raw Normal View History

2021-11-16 21:48:55 +00:00
From b7314cbd4f13f1c7bf86b4e05b20a0a12759124b Mon Sep 17 00:00:00 2001
From: Christopher <christopher@clatza.dev>
Date: Tue, 16 Nov 2021 22:47:01 +0100
Subject: [PATCH] add some null checks
---
.../Region/Framework/Scenes/SceneObjectPartInventory.cs | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index d91f84afe1..9fe7fb66dc 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -746,11 +746,20 @@ namespace OpenSim.Region.Framework.Scenes
/// </param>
public void RemoveScriptInstance(UUID itemId, bool sceneObjectBeingDeleted)
{
+ if (m_items == null)
+ return;
+
if (m_items.ContainsKey(itemId))
{
if (!sceneObjectBeingDeleted)
m_part.RemoveScriptEvents(itemId);
+ if (m_part == null)
+ return;
+
+ if (m_part.ParentGroup == null)
+ return;
+
m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemId);
m_part.ParentGroup.AddActiveScriptCount(-1);
}
--
2.30.1.windows.1