From 4dd1c6688a5fb2137b302f3a8a2dfa90fb3b1cf6 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 23 Aug 2004 08:44:47 +0000 Subject: [PATCH] Added protection to prevent crashes on calls when no data is set up --- src/osgTerrain/DataSet.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/osgTerrain/DataSet.cpp b/src/osgTerrain/DataSet.cpp index 8b2c02e0d..bb2612ed5 100644 --- a/src/osgTerrain/DataSet.cpp +++ b/src/osgTerrain/DataSet.cpp @@ -55,6 +55,8 @@ enum CoordinateSystemType CoordinateSystemType getCoordinateSystemType(const osg::CoordinateSystemNode* lhs) { + if (!lhs) return PROJECTED; + // set up LHS SpatialReference char* projection_string = strdup(lhs->getCoordinateSystem().c_str()); char* importString = projection_string; @@ -3252,6 +3254,7 @@ DataSet::CompositeDestination* DataSet::createDestinationGraph(CompositeDestinat void DataSet::computeDestinationGraphFromSources(unsigned int numLevels) { + if (!_sourceGraph) return; // ensure we have a valid coordinate system if (!_destinationCoordinateSystem) @@ -3375,6 +3378,8 @@ void DataSet::CompositeSource::sort() void DataSet::updateSourcesForDestinationGraphNeeds() { + if (!_destinationGraph || !_sourceGraph) return; + std::string temporyFilePrefix("temporaryfile_"); @@ -3487,6 +3492,8 @@ void DataSet::updateSourcesForDestinationGraphNeeds() void DataSet::populateDestinationGraphFromSources() { + if (!_destinationGraph || !_sourceGraph) return; + osg::notify(osg::NOTICE)<