Fixed nullrefs

avinationmerge
CasperW 2009-11-23 19:51:40 +01:00
parent 889ce36afa
commit 73c2162ff6
2 changed files with 29 additions and 21 deletions

View File

@ -266,8 +266,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
} }
// m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType);
if (c.Scene != null)
((Scene)c.Scene).ForEachScenePresence( {
((Scene)c.Scene).ForEachScenePresence
(
delegate(ScenePresence presence) delegate(ScenePresence presence)
{ {
// ignore chat from child agents // ignore chat from child agents
@ -284,7 +286,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID,
(byte)sourceType, (byte)ChatAudibleLevel.Fully); (byte)sourceType, (byte)ChatAudibleLevel.Fully);
}); }
);
}
} }

View File

@ -840,8 +840,12 @@ namespace OpenSim.Region.Framework.Scenes
public void RemoveTaskInventory(IClientAPI remoteClient, UUID itemID, uint localID) public void RemoveTaskInventory(IClientAPI remoteClient, UUID itemID, uint localID)
{ {
SceneObjectPart part = GetSceneObjectPart(localID); SceneObjectPart part = GetSceneObjectPart(localID);
SceneObjectGroup group = part.ParentGroup; SceneObjectGroup group = null;
if (group != null) if (part != null)
{
group = part.ParentGroup;
}
if (part != null && group != null)
{ {
TaskInventoryItem item = group.GetInventoryItem(localID, itemID); TaskInventoryItem item = group.GetInventoryItem(localID, itemID);
if (item == null) if (item == null)