c# - Weird Exception with JSON.Net in MonoTouch -


i'm getting similar error post here.

i'm parsing json json.net on background thread him. sporadically fails error in array.copy.

here stacktrace:

system.nullreferenceexception: object reference not set instance of object   @ system.array.copy (system.array sourcearray, int32 sourceindex, system.array destinationarray, int32 destinationindex, int32 length) [0x00104] in /developer/monotouch/source/mono/mcs/class/corlib/system/array.cs:979    @ system.collections.arraylist.copyto (int32 index, system.array array, int32 arrayindex, int32 count) [0x0002d] in /developer/monotouch/source/mono/mcs/class/corlib/system.collections/arraylist.cs:3064    @ system.collections.arraylist.copyto (system.array array, int32 arrayindex) [0x00000] in /developer/monotouch/source/mono/mcs/class/corlib/system.collections/arraylist.cs:3046    @ system.monocustomattrs.getcustomattributes (icustomattributeprovider obj, system.type attributetype, boolean inherit) [0x0026c] in /developer/monotouch/source/mono/mcs/class/corlib/system/monocustomattrs.cs:259    @ system.monotype.getcustomattributes (system.type attributetype, boolean inherit) [0x00011] in /developer/monotouch/source/mono/mcs/class/corlib/system/monotype.cs:582    @ newtonsoft.json.utilities.reflectionutils.getattributes[jsonconverterattribute] (icustomattributeprovider attributeprovider, boolean inherit) [0x00000] in <filename unknown>:0    @ newtonsoft.json.utilities.reflectionutils.getattribute[jsonconverterattribute] (icustomattributeprovider attributeprovider, boolean inherit) [0x00000] in <filename unknown>:0    ... continues ... 

here offending code in json.net:

#if !(netfx_core)     public static t[] getattributes<t>(icustomattributeprovider attributeprovider, bool inherit) t : attribute     {       validationutils.argumentnotnull(attributeprovider, "attributeprovider");        object provider;  #if !portable       provider = attributeprovider; #else  ...  omitted junk ...        if (provider type)         return (t[])((type)provider).getcustomattributes(typeof(t), inherit); 

i'm guessing getcustomattributes returning null. has @ xamarin been aware of issue? guy on newsgroup said put work on main thread , fixed (but i'm not sure want that).

this known bug.

it fixed in 5.3.3 alpha release.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -