avoid error when asking attributes for a node which don't have them

Hi, could you merge my little change? it's just a check to avoid crash when asking for attributes in a node which don't have any attribute.

This works on xcode6-beta2, but i'm not able to make the library to compile on beta3. Did you try something maybe? If i come up with some solutions i'll make another pull request