fix null pointer

fix null pointer where schema ComplexType in a document does not declare a schema attribute
Merge pull request #933 from bitsofinfo/master

Fix for issue #932