Avoid crash during parse .csd file.

This commit is contained in:
pipu 2015-03-18 10:28:12 +08:00
parent 1e271a9d96
commit faf9d6b01c
1 changed files with 4 additions and 1 deletions

View File

@ -1276,7 +1276,10 @@ Node* CSLoader::nodeWithFlatBuffersForSimulator(const flatbuffers::NodeTree *nod
readername.append("Reader");
NodeReaderProtocol* reader = dynamic_cast<NodeReaderProtocol*>(ObjectFactory::getInstance()->createObject(readername));
node = reader->createNodeWithFlatBuffers(options->data());
if (reader)
{
node = reader->createNodeWithFlatBuffers(options->data());
}
Widget* widget = dynamic_cast<Widget*>(node);
if (widget)