Fixed check against null

This commit is contained in:
Robert Osfield 2016-06-23 10:05:50 +01:00
parent 07b6016c61
commit 57b999b310

View File

@ -222,8 +222,8 @@ osg::ref_ptr<osg::Node> p3d::readShowFiles(osg::ArgumentParser& arguments,const
while (arguments.read("--movie",filename))
{
osg::ref_ptr<osg::Image> image = readRefImageFile(filename.c_str(), local_options.get());
osg::ref_ptr<osg::ImageStream> imageStream = dynamic_cast<osg::ImageStream*>(image.get());
if (image.valid())
osg::ImageStream* imageStream = dynamic_cast<osg::ImageStream*>(image.get());
if (imageStream)
{
imageStream->play();
nodeList.push_back(osg::createGeodeForImage(imageStream));