Changeset 918

Show
Ignore:
Timestamp:
06/18/08 18:52:08
Author:
robert
Message:

Added check against possible num ShapeAttribute?::getString()

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/vpb/ShapeFilePlacer.cpp

    r850 r918  
    464464                    for(osgSim::ShapeAttributeList::iterator sitr = sal->begin(); sitr != sal->end(); ++sitr) 
    465465                    { 
    466                         if ((sitr->getName() == getTypeAttributeName()) && (sitr->getType() == osgSim::ShapeAttribute::STRING)) 
     466                        if ((sitr->getName() == getTypeAttributeName()) && 
     467                            (sitr->getType() == osgSim::ShapeAttribute::STRING)) 
    467468                        { 
    468                             if (strncmp(sitr->getString(), "Building", 8) == 0) shapeType = Building; 
    469                             else if (strncmp(sitr->getString(), "Forest", 6) == 0) shapeType = Forest;                                     
     469                            if (sitr->getString()) 
     470                            { 
     471                                if (strncmp(sitr->getString(), "Building", 8) == 0) shapeType = Building; 
     472                                else if (strncmp(sitr->getString(), "Forest", 6) == 0) shapeType = Forest; 
     473                            } 
    470474                        } 
    471475