Skip to content

Commit

Permalink
fix coverity issue 1075920 (null deref), re #11062
Browse files Browse the repository at this point in the history
  • Loading branch information
FedeMPouzols committed Feb 14, 2015
1 parent 7a7e29f commit 308aa94
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Code/Mantid/Framework/Algorithms/src/Integration.cpp
Expand Up @@ -121,11 +121,13 @@ void Integration::exec() {
if (axisIsText) {
Mantid::API::TextAxis *newAxis =
dynamic_cast<Mantid::API::TextAxis *>(outputWorkspace->getAxis(1));
newAxis->setLabel(outWI, localworkspace->getAxis(1)->label(i));
if (newAxis)
newAxis->setLabel(outWI, localworkspace->getAxis(1)->label(i));
} else if (axisIsNumeric) {
Mantid::API::NumericAxis *newAxis =
dynamic_cast<Mantid::API::NumericAxis *>(outputWorkspace->getAxis(1));
newAxis->setValue(outWI, (*(localworkspace->getAxis(1)))(i));
if (newAxis)
newAxis->setValue(outWI, (*(localworkspace->getAxis(1)))(i));
}

// This is the output
Expand Down

0 comments on commit 308aa94

Please sign in to comment.