From 73cdc67367ed0d96636d2e91729dca473caddd85 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 30 Jun 2016 08:02:29 +0100 Subject: [PATCH] Addd handling of NULL --- src/osgPlugins/ply/plyfile.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/osgPlugins/ply/plyfile.cpp b/src/osgPlugins/ply/plyfile.cpp index c562add9c..e75da1c5f 100644 --- a/src/osgPlugins/ply/plyfile.cpp +++ b/src/osgPlugins/ply/plyfile.cpp @@ -1026,6 +1026,13 @@ void ply_get_element_setup( PlyFile *plyfile, char *elem_name, int nprops, /* find information about the element */ elem = find_element (plyfile, elem_name); + if (!elem) + { + fprintf ( stderr, "Warning: Can't find in element '%s'\n", elem_name ); + return; + } + + plyfile->which_elem = elem; /* deposit the property information into the element's description */