Add check for internal data in attach internal node function.

Fixes #80 

Since internal data is a pointer and isn't guaranteed we should check that it
exists before dereferencing it.