LIBOMV-939: Gridproxy invalid cast exception on misformatted CAPS

Patch by Dahlia

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@3603 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
Latif Khalifa
2012-03-31 00:17:26 +00:00
parent 387a9463e6
commit 4260a321ac

View File

@@ -1022,8 +1022,16 @@ namespace GridProxy
{
if (stage != CapsStage.Response) return false;
OSDMap map = (OSDMap)capReq.Response;
OSDArray array = (OSDArray)map["events"];
OSDMap map = null;
if (capReq.Response is OSDMap)
map = (OSDMap)capReq.Response;
else return false;
OSDArray array = null;
if (map.ContainsKey("events") && map["events"] is OSDArray)
array = (OSDArray)map["events"];
else
return false;
for (int i = 0; i < array.Count; i++)
{