- theRefObjects.Append( aRefImage );
- theRefNames.append( aRefImage->GetName() );
- GetObjectReferences( aRefImage, theRefObjects, theRefNames );
+ theRefObjects.Append( aRefObj );
+ theRefNames.append( aRefObj->GetName() );
+ if( aRefObj->GetKind() == KIND_IMAGE )
+ {
+ Handle(HYDROData_Image) aRefImage = Handle(HYDROData_Image)::DownCast( aRefObj );
+ if( !aRefImage.IsNull() )
+ GetObjectReferences( aRefImage, theRefObjects, theRefNames );
+ }