diff options
author | Mic Bowman | 2013-02-08 22:43:15 -0800 |
---|---|---|
committer | Mic Bowman | 2013-02-08 22:43:15 -0800 |
commit | 7bb82c8f2ed987410342c1367dde24b695593eec (patch) | |
tree | 545fe97d94054748a4042df16230e3e9ca3e5bd5 /OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs | |
parent | Broaden the internal OSD type checks to parse JSON that has (diff) | |
download | opensim-SC-7bb82c8f2ed987410342c1367dde24b695593eec.zip opensim-SC-7bb82c8f2ed987410342c1367dde24b695593eec.tar.gz opensim-SC-7bb82c8f2ed987410342c1367dde24b695593eec.tar.bz2 opensim-SC-7bb82c8f2ed987410342c1367dde24b695593eec.tar.xz |
Make JsonStore path parsing more robust. Should fix the
invalid path problem.
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs index d75cd32..e436304 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs | |||
@@ -301,7 +301,16 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore | |||
301 | [ScriptInvocation] | 301 | [ScriptInvocation] |
302 | public string JsonList2Path(UUID hostID, UUID scriptID, object[] pathlist) | 302 | public string JsonList2Path(UUID hostID, UUID scriptID, object[] pathlist) |
303 | { | 303 | { |
304 | return JsonStore.CanonicalPathExpression(ConvertList2Path(pathlist)); | 304 | string ipath = ConvertList2Path(pathlist); |
305 | string opath; | ||
306 | |||
307 | if (JsonStore.CanonicalPathExpression(ipath,out opath)) | ||
308 | return opath; | ||
309 | |||
310 | // This won't parse if passed to the other routines as opposed to | ||
311 | // returning an empty string which is a valid path and would overwrite | ||
312 | // the entire store | ||
313 | return "**INVALID**"; | ||
305 | } | 314 | } |
306 | 315 | ||
307 | // ----------------------------------------------------------------- | 316 | // ----------------------------------------------------------------- |
@@ -421,6 +430,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore | |||
421 | // ----------------------------------------------------------------- | 430 | // ----------------------------------------------------------------- |
422 | protected void GenerateRuntimeError(string msg) | 431 | protected void GenerateRuntimeError(string msg) |
423 | { | 432 | { |
433 | m_log.InfoFormat("[JsonStore] runtime error: {0}",msg); | ||
424 | throw new Exception("JsonStore Runtime Error: " + msg); | 434 | throw new Exception("JsonStore Runtime Error: " + msg); |
425 | } | 435 | } |
426 | 436 | ||