change ossl error report and NPC create error handling

0.9.1.0-post-fixes
UbitUmarov 2018-10-20 15:25:28 +01:00
parent 8b5b251d1a
commit 05b79e203d
1 changed files with 11 additions and 10 deletions

View File

@ -141,7 +141,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
internal ThreatLevel m_MaxThreatLevel = ThreatLevel.VeryLow;
internal float m_ScriptDelayFactor = 1.0f;
internal float m_ScriptDistanceFactor = 1.0f;
internal bool m_debuggerSafe = false;
internal bool m_debuggerSafe = true;
internal Dictionary<string, FunctionPerms > m_FunctionPerms = new Dictionary<string, FunctionPerms >();
protected IUrlModule m_UrlModule = null;
protected ISoundModule m_SoundModule = null;
@ -158,7 +158,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if(m_osslconfig == null)
m_osslconfig = m_ScriptEngine.Config;
m_debuggerSafe = m_ScriptEngine.Config.GetBoolean("DebuggerSafe", false);
m_debuggerSafe = m_ScriptEngine.Config.GetBoolean("DebuggerSafe", m_debuggerSafe);
m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>();
m_SoundModule = m_ScriptEngine.World.RequestModuleInterface<ISoundModule>();
@ -2970,10 +2970,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (appearance == null)
{
string appearanceSerialized = LoadNotecard(notecard);
if (appearanceSerialized != null)
if(!string.IsNullOrWhiteSpace(notecard))
{
string appearanceSerialized = LoadNotecard(notecard);
if (appearanceSerialized == null)
{
OSSLError(string.Format("osNpcCreate: Notecard '{0}' not found.", notecard));
return new LSL_Key(UUID.Zero.ToString());
}
try
{
OSDMap appearanceOsd = (OSDMap)OSDParser.DeserializeLLSDXml(appearanceSerialized);
@ -2982,14 +2987,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
catch
{
OSSLError(string.Format("osNpcCreate: Error processing notcard '{0}'", notecard));
OSSLError(string.Format("osNpcCreate: Error processing notecard '{0}'", notecard));
return new LSL_Key(UUID.Zero.ToString());
}
}
else
{
OSSLError(string.Format("osNpcCreate: Notecard reference '{0}' not found.", notecard));
}
}
UUID ownerID = UUID.Zero;