refactor: In llGetNotecardLine() use existing GetInventoryItem() rather than inspecting a clone of the TaskInventory dictionary that was not cloned thread-safe
parent
1816ecb747
commit
2f998fce1f
|
@ -10558,20 +10558,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
TaskInventoryDictionary itemsDictionary = (TaskInventoryDictionary)m_host.TaskInventory.Clone();
|
|
||||||
|
|
||||||
UUID assetID = UUID.Zero;
|
UUID assetID = UUID.Zero;
|
||||||
|
|
||||||
if (!UUID.TryParse(name, out assetID))
|
if (!UUID.TryParse(name, out assetID))
|
||||||
{
|
{
|
||||||
foreach (TaskInventoryItem item in itemsDictionary.Values)
|
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(name);
|
||||||
{
|
|
||||||
if (item.Type == 7 && item.Name == name)
|
if (item != null && item.Type == 7)
|
||||||
{
|
assetID = item.AssetID;
|
||||||
assetID = item.AssetID;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (assetID == UUID.Zero)
|
if (assetID == UUID.Zero)
|
||||||
|
|
Loading…
Reference in New Issue