ej icon indicating copy to clipboard operation
ej copied to clipboard

Error - index_for_non_list

Open Kozlov-V opened this issue 10 years ago • 2 comments

Sametime i has response with JSON suchlike:

{"results":null}

and i have a problem when try ej:get({"results", 1, "Subject"}, DecodeJSON). How fix this error:

 {{index_for_non_list,{1,null}},
[{ej,get_value,2,[{file,"src/ej.erl"},{line,151}]},
{ej,get0,2,[{file,"src/ej.erl"},{line,107}]},

Thank you!

Kozlov-V avatar Jun 17 '14 09:06 Kozlov-V

Interesting. I guess we should fix this and have it behave similarly to other deep path requests that don't exist and return undefined.

Seems related to #13

Until there's a fix, you'll need to test that you have a non-null I'm afraid.

seth avatar Jun 22 '14 17:06 seth

Thank you! I fix it with test non-null

Kozlov-V avatar Jun 23 '14 07:06 Kozlov-V