[cortex-vfx] r4609 committed - protecting bad group naming with warnings rather than seg faults

0 views
Skip to first unread message

corte...@googlecode.com

unread,
Feb 27, 2012, 2:24:13 PM2/27/12
to cortex...@googlegroups.com
Revision: 4609
Author: andrewk.imageengine
Date: Mon Feb 27 11:23:33 2012
Log: protecting bad group naming with warnings rather than seg faults
http://code.google.com/p/cortex-vfx/source/detail?r=4609

Modified:
/trunk/contrib/IECoreHoudini/src/ToHoudiniGeometryConverter.cpp

=======================================
--- /trunk/contrib/IECoreHoudini/src/ToHoudiniGeometryConverter.cpp Fri Feb
17 17:35:19 2012
+++ /trunk/contrib/IECoreHoudini/src/ToHoudiniGeometryConverter.cpp Mon Feb
27 11:23:33 2012
@@ -229,7 +229,14 @@
group = geo->createElementGroup( GA_ATTRIB_POINT, name );
}

- group->addRange( newPoints );
+ if ( group )
+ {
+ group->addRange( newPoints );
+ }
+ else
+ {
+ IECore::msg(
IECore::MessageHandler::Warning, "ToHoudiniGeometryConverter", "Group " +
nameData->readable() + " is invalid." );
+ }
}

if ( newPrims.isValid() )
@@ -240,7 +247,14 @@
group = geo->createElementGroup( GA_ATTRIB_PRIMITIVE, name );
}

- group->addRange( newPrims );
+ if ( group )
+ {
+ group->addRange( newPrims );
+ }
+ else
+ {
+ IECore::msg(
IECore::MessageHandler::Warning, "ToHoudiniGeometryConverter", "Group " +
nameData->readable() + " is invalid." );
+ }
}
}
}

Reply all
Reply to author
Forward
0 new messages