Problem with Newgrounds API

I added in medals to my game and it just crashes. looking at the code it seems to be crashing right when i do the check for if you are logged in. How do i fix this