fixed potential null pointer
Merge pull request #56 from occamlabs/layer-nullpointer-fix

fixed potential null pointer