Fem: Fix crash in pipeline
This commit is contained in:
committed by
Chris Hennes
parent
aa5feb3df0
commit
88940fb375
@@ -571,6 +571,9 @@ void FemPostPipeline::setTimeInfo(const std::string& frameType, const Base::Unit
|
||||
fd_block->AddArray(timeInfo);
|
||||
for (unsigned int i = 0; i < multiblock->GetNumberOfBlocks(); ++i) {
|
||||
vtkDataObject* grid = multiblock->GetBlock(i);
|
||||
if (!grid) {
|
||||
continue;
|
||||
}
|
||||
auto fd_grid = grid->GetFieldData();
|
||||
if (fd_grid) {
|
||||
// add time info to each grid
|
||||
|
||||
@@ -80,10 +80,9 @@ std::vector<double> vtkFemFrameSourceAlgorithm::getFrameValues()
|
||||
std::vector<double> tFrames(nblocks);
|
||||
|
||||
for (unsigned long i = 0; i < nblocks; i++) {
|
||||
|
||||
vtkDataObject* block = multiblock->GetBlock(i);
|
||||
// check if the TimeValue field is available
|
||||
if (!block->GetFieldData()->HasArray("TimeValue")) {
|
||||
if (!block || !block->GetFieldData() || !block->GetFieldData()->HasArray("TimeValue")) {
|
||||
// a frame with no valid value is a undefined state
|
||||
return std::vector<double>();
|
||||
}
|
||||
@@ -94,7 +93,6 @@ std::vector<double> vtkFemFrameSourceAlgorithm::getFrameValues()
|
||||
// a frame with no valid value is a undefined state
|
||||
return std::vector<double>();
|
||||
}
|
||||
|
||||
tFrames[i] = vtkFloatArray::SafeDownCast(TimeValue)->GetValue(0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user