Merge pull request #10934 from pipu/avoid_crash_parse_csd

Avoid crash during parse .csd file.
This commit is contained in:
minggo 2015-03-18 13:49:52 +08:00
commit 465d2dc415
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)